mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
feat($rootScope): allow passing locals argument to $evalAsync
Closes #10390
This commit is contained in:
committed by
Peter Bacon Darwin
parent
c90ad96808
commit
9b96cea462
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user