jeffcarp / frontend-hyperpolyglot

The same operations in React, Angular 1&2, Ember, Polymer, Vue, and Riot
http://jeffcarp.github.io/frontend-hyperpolyglot
MIT License
269 stars 22 forks source link

One way data binding in Angular 1 #6

Closed fadamakis closed 8 years ago

fadamakis commented 8 years ago

The correct syntax is <Child foo='::scope.bar' />

https://docs.angularjs.org/guide/expression

jeffcarp commented 8 years ago

Thank you @fadamakis!

jeffcarp commented 8 years ago

Thinking about this more - I think this might require a new section. These are two distinct behaviors:

  1. One-way data binding - where a parent's property is passed down but still updated
  2. One-time data binding - where a parent's property is passed down once and never updated again (e.g. your example <Child foo='::scope.bar' />)