Last active
May 9, 2019 08:30
-
-
Save armanozak/b00449e497748036b393e332289de15e to your computer and use it in GitHub Desktop.
Angular Context - One-way Data-binding (#4) #blog
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
@Component({ | |
selector: 'my-app', | |
template: ` | |
<context-provider | |
provide="progress progressStriped progressType" | |
[contextMap]="{progressType: 'type'}" | |
> | |
<one-way></one-way> | |
</context-provider> | |
`, | |
}) | |
export class AppComponent implements OnInit { | |
progress = 0; | |
progressStriped = true; | |
progressType = 'info'; | |
ngOnInit() { | |
interval(1000).pipe(take(10)).subscribe( | |
n => this.progress = (n + 1) * 10 | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment