Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9b6c154

Browse files
frederikprijckgkalpak
authored andcommitted
docs($compile): update preAssignBindingsEnabled description
Previously, the changelog and migration guide did not mention the fact that this only applies to controllers which are part of a directive/component. This commit ensures the changelog and migration guide mentions this explicitly. Closes #15740 Closes #16162
1 parent 56ac2a7 commit 9b6c154

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,10 @@ consolidating all the changes shown in the previous 1.6.0 release candidates.**
700700
- **feat($compile): set preAssignBindingsEnabled to false by default
701701
([bcd0d4](https://github.com/angular/angular.js/commit/bcd0d4d896d0dfdd988ff4f849c1d40366125858))**:
702702

703-
Previously, `$compileProvider.preAssignBindingsEnabled` was
704-
set to true by default. This means bindings were pre-assigned in component
705-
constructors. In Angular 1.5+ the place to put the initialization logic
706-
relying on bindings being present is the controller `$onInit` method.
703+
Previously, `$compileProvider.preAssignBindingsEnabled` was set to true by default. This means
704+
bindings were pre-assigned on component/directive controller instances (which made them available
705+
inside the constructors). In Angular 1.5+ the place to put the initialization logic relying on
706+
bindings being present is the controller's `$onInit` method.
707707

708708
To migrate follow the example below:
709709

docs/content/guide/migration.ngdoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ commits for more info.
7575
- **$location** now uses `'!'` as the default hash-prefix for hash-bang URLs, instead of the empty
7676
string. ([Details](guide/migration#commit-aa077e8))
7777

78-
- **$compile** will (by default) not pre-assign bindings on controller instances.
79-
([Details](guide/migration#commit-bcd0d4))
78+
- **$compile** will (by default) not pre-assign bindings on component/directive controller
79+
instances. ([Details](guide/migration#commit-bcd0d4))
8080

8181
- **http** imposes additional restrictions to **JSONP** requests for security reasons
8282
(see [details](guide/migration#migrate1.5to1.6-ng-services-$http) below):
@@ -412,14 +412,14 @@ if the option does not provide a value attribute.
412412
<major />
413413
<a name="commit-bcd0d4"></a>
414414
**Due to [bcd0d4](https://github.com/angular/angular.js/commit/bcd0d4d896d0dfdd988ff4f849c1d40366125858)**,
415-
pre-assigning bindings on controller instances is disabled by default. It is still possible to turn
416-
it back on, which should help during the migration. Pre-assigning bindings has been deprecated and
417-
will be removed in a future version, so we strongly recommend migrating your applications to not
418-
rely on it as soon as possible.
415+
pre-assigning bindings on component/directive controller instances is disabled by default, which
416+
means that they will no longer be available inside the constructors. It is still possible to turn it
417+
back on, which should help during the migration. Pre-assigning bindings has been deprecated and will
418+
be removed in a future version, so we strongly recommend migrating your applications to not rely on
419+
it as soon as possible.
419420

420421
Initialization logic that relies on bindings being present should be put in the controller's
421-
`$onInit()` method, which is guaranteed to always be called _after_ the bindings have been
422-
assigned.
422+
`$onInit()` method, which is guaranteed to always be called _after_ the bindings have been assigned.
423423

424424
Before:
425425

0 commit comments

Comments
 (0)