Skip to content

Commit e9253a8

Browse files
refractalizeIgorMinar
authored andcommitted
docs(guide/directive): fix names in scope '='; easier to grok
1 parent f3e053c commit e9253a8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

docs/content/guide/directive.ngdoc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,24 +321,26 @@ compiler}. The attributes are:
321321
derived from the parent scope. These local properties are useful for aliasing values for
322322
templates. Locals definition is a hash of local scope property to its source:
323323

324-
* `@` or `@attr` - bind a local scope property to the DOM attribute. The result is always a
325-
string since DOM attributes are strings. If no `attr` name is specified then the local name
326-
and attribute name are same. Given `<widget my-attr="hello {{name}}">` and widget definition
324+
* `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
325+
always a string since DOM attributes are strings. If no `attr` name is specified then the
326+
attribute name is assumed to be the same as the local name.
327+
Given `<widget my-attr="hello {{name}}">` and widget definition
327328
of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect
328329
the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the
329330
`localName` property on the widget scope. The `name` is read from the parent scope (not
330331
component scope).
331332

332-
* `=` or `=expression` - set up bi-directional binding between a local scope property and the
333-
parent scope property. If no `attr` name is specified then the local name and attribute
334-
name are same. Given `<widget my-attr="parentModel">` and widget definition of
335-
`scope: { localModel:'=myAttr' }`, then widget scope property `localName` will reflect the
333+
* `=` or `=attr` - set up bi-directional binding between a local scope property and the
334+
parent scope property of name defined via the value of the `attr` attribute. If no `attr`
335+
name is specified then the attribute name is assumed to be the same as the local name.
336+
Given `<widget my-attr="parentModel">` and widget definition of
337+
`scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the
336338
value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
337339
in `localModel` and any changes in `localModel` will reflect in `parentModel`.
338340

339341
* `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.
340-
If no `attr` name is specified then the local name and attribute name are same.
341-
Given `<widget my-attr="count = count + value">` and widget definition of
342+
If no `attr` name is specified then the attribute name is assumed to be the same as the
343+
local name. Given `<widget my-attr="count = count + value">` and widget definition of
342344
`scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to
343345
a function wrapper for the `increment()` expression. Often it's desirable to pass data from
344346
the isolate scope via an expression and to the parent scope, this can be done by passing a

0 commit comments

Comments
 (0)