import { Component, Input, NgModule, ɵmarkDirty as markDirty }
from '@angular/core';
import { ButtonDirective } from './button.directive';
@Component({ selector: 'zippy',
template: `{{title}}
`,
})
export class ZippyComponent {
@Input() title: string;
isExpanded = false;
onToggle() {
this.isExpanded = !this.isExpanded;
markDirty(this);
}
}
@NgModule({ declarations: [
ZippyComponent,
ButtonDirective,
] })
export class ZippyRenderModule {}
Component render
modules
(Ivy preview with JIT)
ANGULAR REVISITED: TREE-SHAKABLE COMPONENTS AND OPTIONAL NGMODULES