Skip to content

Commit 9f9971d

Browse files
bgevernetman92
authored andcommitted
docs(guide/Migrating): add breaking change for 1.4 regarding controller constructors.
If you previously returned a object from a controller constructor function, it would not be bound to the scope. As of 1.4 it does, and can cause unexpected objects as the scope. Closes angular#12227
1 parent 70b382e commit 9f9971d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/content/guide/migration.ngdoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ Due to [6a38dbfd](https://github.com/angular/angular.js/commit/6a38dbfd3c34c8f9e
246246
previously, '&' expressions would always set up a function in the isolate scope. Now, if the binding
247247
is marked as optional and the attribute is not specified, no function will be added to the isolate scope.
248248

249+
Due to [62d514b](https://github.com/angular/angular.js/commit/62d514b06937cc7dd86e973ea11165c88343b42d),
250+
returning an object from a controller constructor function will now override the scope. Views that use the
251+
controllerAs method will no longer get the this reference, but the returned object.
249252

250253

251254
## Cookies (`ngCookies`)

0 commit comments

Comments
 (0)