mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 12:05:46 +08:00
feat(scope): new and improved scope implementation
- Speed improvements (about 4x on flush phase) - Memory improvements (uses no function closures) - Break $eval into $apply, $dispatch, $flush - Introduced $watch and $observe Breaks angular.equals() use === instead of == Breaks angular.scope() does not take parent as first argument Breaks scope.$watch() takes scope as first argument Breaks scope.$set(), scope.$get are removed Breaks scope.$config is removed Breaks $route.onChange callback has not "this" bounded
This commit is contained in:
@@ -16,7 +16,7 @@ describe('$cookieStore', function() {
|
||||
|
||||
it('should serialize objects to json', function() {
|
||||
$cookieStore.put('objectCookie', {id: 123, name: 'blah'});
|
||||
scope.$eval(); //force eval in test
|
||||
scope.$flush();
|
||||
expect($browser.cookies()).toEqual({'objectCookie': '{"id":123,"name":"blah"}'});
|
||||
});
|
||||
|
||||
@@ -30,12 +30,12 @@ describe('$cookieStore', function() {
|
||||
|
||||
it('should delete objects from the store when remove is called', function() {
|
||||
$cookieStore.put('gonner', { "I'll":"Be Back"});
|
||||
scope.$eval(); //force eval in test
|
||||
scope.$flush(); //force eval in test
|
||||
$browser.poll();
|
||||
expect($browser.cookies()).toEqual({'gonner': '{"I\'ll":"Be Back"}'});
|
||||
|
||||
$cookieStore.remove('gonner');
|
||||
scope.$eval();
|
||||
scope.$flush();
|
||||
expect($browser.cookies()).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user