diff options
| author | Tim Macfarlane | 2012-11-07 09:23:20 +0000 | 
|---|---|---|
| committer | Igor Minar | 2012-11-11 11:20:24 +0100 | 
| commit | e9253a88b912ef5e43b43a3ceb7fca266223affb (patch) | |
| tree | 196a08492116cb9a9e9b32ea79c8e8611c319670 /docs | |
| parent | f3e053cb6fec8279e09330481ba8906e185f94c6 (diff) | |
| download | angular.js-e9253a88b912ef5e43b43a3ceb7fca266223affb.tar.bz2 | |
docs(guide/directive): fix names in scope '='; easier to grok
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/guide/directive.ngdoc | 20 | 
1 files changed, 11 insertions, 9 deletions
diff --git a/docs/content/guide/directive.ngdoc b/docs/content/guide/directive.ngdoc index 1dbb41d2..062160a1 100644 --- a/docs/content/guide/directive.ngdoc +++ b/docs/content/guide/directive.ngdoc @@ -321,24 +321,26 @@ compiler}. The attributes are:        derived from the parent scope. These local properties are useful for aliasing values for        templates. Locals definition is a hash of local scope property to its source: -      * `@` or `@attr` - bind a local scope property to the DOM attribute. The result is always a -        string since DOM attributes are strings. If no `attr` name is specified then the local name -        and attribute name are same. Given `<widget my-attr="hello {{name}}">` and widget definition +      * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is +        always a string since DOM attributes are strings. If no `attr` name is specified  then the +        attribute name is assumed to be the same as the local name. +        Given `<widget my-attr="hello {{name}}">` and widget definition          of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect          the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the          `localName` property on the widget scope. The `name` is read from the parent scope (not          component scope). -      * `=` or `=expression` - set up bi-directional binding between a local scope property and the -        parent scope property. If no `attr` name is specified then the local name and attribute -        name are same. Given `<widget my-attr="parentModel">` and widget definition of -        `scope: { localModel:'=myAttr' }`, then widget scope property `localName` will reflect the +      * `=` or `=attr` - set up bi-directional binding between a local scope property and the +        parent scope property of name defined via the value of the `attr` attribute. If no `attr` +        name is specified then the attribute name is assumed to be the same as the local name. +        Given `<widget my-attr="parentModel">` and widget definition of +        `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the          value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected          in `localModel` and any changes in `localModel` will reflect in `parentModel`.        * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. -        If no `attr` name is specified then the local name and attribute name are same. -        Given `<widget my-attr="count = count + value">` and widget definition of +        If no `attr` name is specified then the attribute name is assumed to be the same as the +        local name. Given `<widget my-attr="count = count + value">` and widget definition of          `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to          a function wrapper for the `increment()` expression. Often it's desirable to pass data from          the isolate scope via an expression and to the parent scope, this can be done by passing a  | 
