Skip to content

Instantly share code, notes, and snippets.

@armanozak
Last active May 9, 2019 08:30
Show Gist options
  • Save armanozak/d516f6e8ba7da0182642228545f4a39f to your computer and use it in GitHub Desktop.
Save armanozak/d516f6e8ba7da0182642228545f4a39f to your computer and use it in GitHub Desktop.
Angular Context - One-way Data-binding (#2) #blog
@Component({
selector: 'one-way',
template: `
<context-consumer consume="progress"></context-consumer>
<progressbar
contextConsumer
[contextMap]="{progress: 'value', progressStriped: 'striped'}"
>{{ progress ? progress + '%' : '' }}</progressbar>
`,
})
export class OneWayComponent {
progress: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment