Created
October 17, 2018 16:27
-
-
Save luillyfe/0b3284960909b81a3780a189290fcc6d to your computer and use it in GitHub Desktop.
Angular parent state/ props changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<news title="{{ title }}" content="{{ content }}"></news> | |
<button (click)="printState()">Print parent state</button> | |
/* *** */ | |
export class AppComponent { | |
title="News title"; s | |
content="A description should be here!"; | |
printState() { | |
console.log(`News title: ${this.title}, News content: ${this.content}`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment