feat($rootScope): allow passing locals argument to $evalAsync

Closes #10390
This commit is contained in:
Shahar Talmi
2014-12-09 23:43:13 +02:00
committed by Peter Bacon Darwin
parent c90ad96808
commit 9b96cea462
2 changed files with 11 additions and 3 deletions

View File

@@ -1243,6 +1243,13 @@ describe('Scope', function() {
expect($rootScope.log).toBe('12');
}));
it('should allow passing locals to the expression', inject(function($rootScope) {
$rootScope.log = '';
$rootScope.$evalAsync('log = log + a', {a: 1});
$rootScope.$digest();
expect($rootScope.log).toBe('1');
}));
it('should run async expressions in their proper context', inject(function($rootScope) {
var child = $rootScope.$new();
$rootScope.ctx = 'root context';