mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00:00
- 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
16 lines
478 B
JavaScript
16 lines
478 B
JavaScript
'use strict';
|
|
|
|
describe('$routeParams', function() {
|
|
it('should publish the params into a service', inject(function($rootScope, $route, $location, $routeParams) {
|
|
$route.when('/foo');
|
|
$route.when('/bar/:barId');
|
|
|
|
$location.path('/foo').search('a=b');
|
|
$rootScope.$digest();
|
|
expect($routeParams).toEqual({a:'b'});
|
|
|
|
$location.path('/bar/123').search('x=abc');
|
|
$rootScope.$digest();
|
|
expect($routeParams).toEqual({barId:'123', x:'abc'});
|
|
}));
|
|
});
|