mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
$cookieStore should not be a global service
you must use $inject to $inject it as any other non-global service
This commit is contained in:
parent
d74ef497de
commit
833e0ae343
3 changed files with 12 additions and 4 deletions
|
|
@ -1,3 +1,11 @@
|
|||
# <angular/> 0.9.1 repulsion-field (in-progress) #
|
||||
|
||||
### Breaking changes
|
||||
- $cookieStore service is not globally published any more, if you use it, you must request it via
|
||||
$inject as any other non-global service
|
||||
|
||||
|
||||
|
||||
# <angular/> 0.9.0 dragon-breath (2010-10-20) #
|
||||
|
||||
### Security
|
||||
|
|
|
|||
|
|
@ -641,4 +641,4 @@ angularServiceInject('$cookieStore', function($store) {
|
|||
}
|
||||
};
|
||||
|
||||
}, ['$cookies'], EAGER_PUBLISHED);
|
||||
}, ['$cookies']);
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ describe("service", function(){
|
|||
describe('$cookieStore', function() {
|
||||
|
||||
it('should serialize objects to json', function() {
|
||||
scope.$cookieStore.put('objectCookie', {id: 123, name: 'blah'});
|
||||
scope.$inject('$cookieStore').put('objectCookie', {id: 123, name: 'blah'});
|
||||
scope.$eval(); //force eval in test
|
||||
expect($browser.cookies()).toEqual({'objectCookie': '{"id":123,"name":"blah"}'});
|
||||
});
|
||||
|
|
@ -550,12 +550,12 @@ describe("service", function(){
|
|||
it('should deserialize json to object', function() {
|
||||
$browser.cookies('objectCookie', '{"id":123,"name":"blah"}');
|
||||
$browser.poll();
|
||||
expect(scope.$cookieStore.get('objectCookie')).toEqual({id: 123, name: 'blah'});
|
||||
expect(scope.$inject('$cookieStore').get('objectCookie')).toEqual({id: 123, name: 'blah'});
|
||||
});
|
||||
|
||||
|
||||
it('should delete objects from the store when remove is called', function() {
|
||||
scope.$cookieStore.put('gonner', { "I'll":"Be Back"});
|
||||
scope.$inject('$cookieStore').put('gonner', { "I'll":"Be Back"});
|
||||
scope.$eval(); //force eval in test
|
||||
expect($browser.cookies()).toEqual({'gonner': '{"I\'ll":"Be Back"}'});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue