Last active
May 9, 2019 08:30
-
-
Save armanozak/abfc6d8f5914872d421a63a2208c85a9 to your computer and use it in GitHub Desktop.
Angular Context - One-way Data-binding (#1) #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 { | |
progress = 70; | |
progressStriped = true; | |
progressType = 'info'; | |
} |
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: 'one-way', | |
template: ` | |
<progressbar | |
contextConsumer | |
[contextMap]="{progress: 'value', progressStriped: 'striped'}" | |
></progressbar> | |
`, | |
}) | |
export class OneWayComponent {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment