Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Classe de configuração
- export class Config {
- show: boolean = true;
- }
- // Componente que receberá a classe
- @Component({
- selector: 'component',
- template: '<div *ngIf="show">Can you see me?</div>'
- })
- export class Component {
- @Input() config: Config = new Config(); // instancia a classe para evitar erros
- show: boolean = this.config.show;
- }
- // usando ambos
- <component [config]="config"><component>
Add Comment
Please, Sign In to add comment