Skip to content

Commit 833e0ae

Browse files
IgorMinarmhevery
authored andcommitted
$cookieStore should not be a global service
you must use $inject to $inject it as any other non-global service
1 parent d74ef49 commit 833e0ae

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# <angular/> 0.9.1 repulsion-field (in-progress) #
2+
3+
### Breaking changes
4+
- $cookieStore service is not globally published any more, if you use it, you must request it via
5+
$inject as any other non-global service
6+
7+
8+
19
# <angular/> 0.9.0 dragon-breath (2010-10-20) #
210

311
### Security

src/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,4 @@ angularServiceInject('$cookieStore', function($store) {
641641
}
642642
};
643643

644-
}, ['$cookies'], EAGER_PUBLISHED);
644+
}, ['$cookies']);

test/servicesSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ describe("service", function(){
541541
describe('$cookieStore', function() {
542542

543543
it('should serialize objects to json', function() {
544-
scope.$cookieStore.put('objectCookie', {id: 123, name: 'blah'});
544+
scope.$inject('$cookieStore').put('objectCookie', {id: 123, name: 'blah'});
545545
scope.$eval(); //force eval in test
546546
expect($browser.cookies()).toEqual({'objectCookie': '{"id":123,"name":"blah"}'});
547547
});
@@ -550,12 +550,12 @@ describe("service", function(){
550550
it('should deserialize json to object', function() {
551551
$browser.cookies('objectCookie', '{"id":123,"name":"blah"}');
552552
$browser.poll();
553-
expect(scope.$cookieStore.get('objectCookie')).toEqual({id: 123, name: 'blah'});
553+
expect(scope.$inject('$cookieStore').get('objectCookie')).toEqual({id: 123, name: 'blah'});
554554
});
555555

556556

557557
it('should delete objects from the store when remove is called', function() {
558-
scope.$cookieStore.put('gonner', { "I'll":"Be Back"});
558+
scope.$inject('$cookieStore').put('gonner', { "I'll":"Be Back"});
559559
scope.$eval(); //force eval in test
560560
expect($browser.cookies()).toEqual({'gonner': '{"I\'ll":"Be Back"}'});
561561
});

0 commit comments

Comments
 (0)