This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 212
212
*
213
213
*
214
214
* #### `bindToController`
215
- * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
215
+ * This property is used to bind scope properties directly to the controller. It can be either
216
+ * `true` or an object hash with the same format as the `scope` property. Additionally, a controller
217
+ * alias must be set, either by using `controllerAs: 'myAlias'` or by specifying the alias in the controller
218
+ * definition: `controller: 'myCtrl as myAlias'`.
219
+ *
220
+ * When an isolate scope is used for a directive (see above), `bindToController: true` will
216
221
* allow a component to have its properties bound to the controller, rather than to scope. When the controller
217
222
* is instantiated, the initial values of the isolate scope bindings will be available if the controller is not an ES6 class.
218
223
*
224
+ * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.
225
+ * This will set up the scope bindings to the controller directly. Note that `scope` can still be used
226
+ * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate
227
+ * scope (useful for component directives).
228
+ *
229
+ * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.
230
+ *
231
+ *
219
232
* #### `controller`
220
233
* Controller constructor function. The controller is instantiated before the
221
234
* pre-linking phase and can be accessed by other directives (see
You can’t perform that action at this time.
0 commit comments