Skip to content
Permalink
Browse files

docs($compile): add docs for bindToController with object hash

Closes #13228
Closes #13625
Closes #13658
Closes #13681
  • Loading branch information
Narretz committed Dec 31, 2015
1 parent d28ae21 commit 495d40d802d050326d1c375942a7ff21b13c12e8
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/ng/compile.js
@@ -212,10 +212,23 @@
*
*
* #### `bindToController`
* When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
* This property is used to bind scope properties directly to the controller. It can be either
* `true` or an object hash with the same format as the `scope` property. Additionally, a controller
* alias must be set, either by using `controllerAs: 'myAlias'` or by specifying the alias in the controller
* definition: `controller: 'myCtrl as myAlias'`.
*
* When an isolate scope is used for a directive (see above), `bindToController: true` will
* allow a component to have its properties bound to the controller, rather than to scope. When the controller
* is instantiated, the initial values of the isolate scope bindings will be available if the controller is not an ES6 class.
*
* It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.
* This will set up the scope bindings to the controller directly. Note that `scope` can still be used
* to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate
* scope (useful for component directives).
*
* If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.
*
*
* #### `controller`
* Controller constructor function. The controller is instantiated before the
* pre-linking phase and can be accessed by other directives (see

0 comments on commit 495d40d

Please sign in to comment.
You can’t perform that action at this time.