refactor(injector): turn scope into a service

- turn scope into a $rootScope service.
- injector is now a starting point for creating angular application.
- added inject() method which wraps jasmine its/beforeEach/afterEach,
  and which allows configuration and injection of services.
- refactor tests to use inject() where possible

BREAK:
- removed angular.scope() method
This commit is contained in:
Misko Hevery
2011-10-17 16:56:56 -07:00
parent 93b777c916
commit 48697a2b86
51 changed files with 3050 additions and 3135 deletions

View File

@@ -2,8 +2,9 @@ describe('example.personalLog.LogCtrl', function() {
var logCtrl;
function createNotesCtrl() {
var scope = angular.scope();
scope.$cookies = scope.$service('$cookies');
var injector = angular.injector();
var scope = injector('$rootScope');
scope.$cookies = injector('$cookies');
return scope.$new(example.personalLog.LogCtrl);
}