fix(upgrade): pass correct values to ngOnChanges for interpolation bindings (#14301)

Previously, the `previousValue` and `currentValue` arguments passed to the
`SimpleChange` constructor were swapped for interpolation bindings.

This commit also refactors the code, so that interpolation bindings and property
bindings share the same implementation, and fixes some broken tests (that hide
failures by allowing the `$exceptionHandler` to swallow thrown exceptions).

PR Close #14301
This commit is contained in:
Georgios Kalpakas
2017-02-04 17:19:09 +02:00
committed by Miško Hevery
parent 701074cf89
commit 1e3dd3dd9b
5 changed files with 88 additions and 58 deletions

View File

@ -24,7 +24,12 @@ export function bootstrap(
});
}
export function digest(adapter: UpgradeModule) {
export function $apply(adapter: UpgradeModule, exp: angular.Ng1Expression) {
const $rootScope = adapter.$injector.get($ROOT_SCOPE) as angular.IRootScopeService;
$rootScope.$apply(exp);
}
export function $digest(adapter: UpgradeModule) {
const $rootScope = adapter.$injector.get($ROOT_SCOPE) as angular.IRootScopeService;
$rootScope.$digest();
}