8000 fix($compile): still trigger `$onChanges` even if the inner value alr… by petebacondarwin · Pull Request #14406 · angular/angular.js · GitHub
[go: up one dir, main page]

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

fix($compile): still trigger $onChanges even if the inner value alr… #14406

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix($compile): still trigger $onChanges even if the inner value alr…
…eady matches the new value
  • Loading branch information
petebacondarwin committed Apr 10, 2016
commit d8c84b444a4d8cdf9413698633708cf3ce6c62da
5 changes: 1 addition & 4 deletions test/ng/compileSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3755,15 +3755,12 @@ describe('$compile', function() {

module('my');
inject(function($compile, $rootScope) {
$rootScope.getVal = function() { return $rootScope.val; };
element = $compile('<c1 prop1="val"></c1>')($rootScope);
var isolateScope = element.isolateScope();

log = [];
$rootScope.$apply('val = 1');
expect(log.pop()).toEqual({prop1: jasmine.objectContaining({previousValue: undefined, currentValue: 1})});

isolateScope.$ctrl.prop1 = 2;
element.isolateScope().$ctrl.prop1 = 2;
$rootScope.$apply('val = 2');
expect(log.pop()).toEqual({prop1: jasmine.objectContaining({previousValue: 1, currentValue: 2})});
});
Expand Down
0