mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-25 06:13:44 +00:00
docs(guide/directive): rephrase for consistency
- referring to `=attr` rather than `=prop` is consistent with note under example with =customerInfo - change `prop` to `attr` (basically `prop` refers to property in JS object, `attr` is for HTML tag) - change the function name in description to match the name in code example Closes #5786
This commit is contained in:
parent
61eb426ab4
commit
51a7f9dc4a
1 changed files with 4 additions and 4 deletions
|
|
@ -734,13 +734,13 @@ own behavior to it.
|
||||||
We want to run the function we pass by invoking it from the directive's scope, but have it run
|
We want to run the function we pass by invoking it from the directive's scope, but have it run
|
||||||
in the context of the scope where its registered.
|
in the context of the scope where its registered.
|
||||||
|
|
||||||
We saw earlier how to use `=prop` in the `scope` option, but in the above example, we're using
|
We saw earlier how to use `=attr` in the `scope` option, but in the above example, we're using
|
||||||
`&prop` instead. `&` bindings expose a function to an isolated scope allowing the isolated scope
|
`&attr` instead. `&` bindings expose a function to an isolated scope allowing the isolated scope
|
||||||
to invoke it, but maintaining the original scope of the function. So when a user clicks the
|
to invoke it, but maintaining the original scope of the function. So when a user clicks the
|
||||||
`x` in the dialog, it runs `Ctrl`'s `close` function.
|
`x` in the dialog, it runs `Ctrl`'s `hideDialog` function.
|
||||||
|
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success">
|
||||||
**Best Practice:** use `&prop` in the `scope` option when you want your directive
|
**Best Practice:** use `&attr` in the `scope` option when you want your directive
|
||||||
to expose an API for binding to behaviors.
|
to expose an API for binding to behaviors.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue