Skip to content

Instantly share code, notes, and snippets.

@chidumennamdi
Created August 22, 2018 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chidumennamdi/60c96f989d4b678b702ef6f25418f7b1 to your computer and use it in GitHub Desktop.
Save chidumennamdi/60c96f989d4b678b702ef6f25418f7b1 to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-parent',
template: `
<my-i [iHuman]="pHuman"></my-i>
<button (click)="incrId()">Incr. Id</button>
<button (click)="chgName()">Change Name</button>
`
})
export class PComponent{
pHuman:any = {
id:0,
name: "Nnamdi"
}
incrId(){
this.pHuman.id++
}
chgName(){
this.pHuman.name = "Chidume"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment