I've got this structure :
@Component({
selector: "parent-component",
template: `
<div>
<child-component *ngIf='isLogin'></child-component>
</div>
`,
})
export class ParentComponent {
public isLogin = false;
myFunction( ) {
if (something) this.isLogin = true;
}
}
and
@Component({
selector: "dropteam-header-user",
template: `
<button (click)="trigger()">Click me</button>
`,
})
export class ChildComponent {
trigger() {
// change ParentComponent's isLogin property here
}
}
I believe this is very basic stuff here. I just need to be able to change ParentComponent
property within the ChildComponent
. ParentComponent
should also be able to change his own property.
Thanks.