
committed by
Igor Minar

parent
f48b343af1
commit
0f5c70d563
2
modules/angular1_router/build.js
vendored
2
modules/angular1_router/build.js
vendored
@ -103,6 +103,7 @@ if (require.main === module) {
|
||||
args.shift(); // node
|
||||
args.shift(); // scriptfile.js
|
||||
if (args.length < 2) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log("usage: $0 outFile path/to/modules");
|
||||
process.exit(1);
|
||||
}
|
||||
@ -110,6 +111,7 @@ if (require.main === module) {
|
||||
var directory = args.shift();
|
||||
fs.writeFileSync(outfile, main(directory));
|
||||
} catch (e) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log(e.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ function $locationHashPrefixProvider($locationProvider) {
|
||||
hashPrefix = prefix;
|
||||
}
|
||||
return hashPrefixFn(prefix);
|
||||
}
|
||||
};
|
||||
|
||||
// Return the final hashPrefix as the value of this service
|
||||
this.$get = function() { return hashPrefix; };
|
||||
@ -110,7 +110,7 @@ function routerFactory($q, $location, $browser, $rootScope, $injector, $routerRo
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var registry = new RouteRegistry($routerRootComponent);
|
||||
var location = new Location();
|
||||
|
@ -32,11 +32,11 @@ describe('Navigation lifecycle', function () {
|
||||
|
||||
registerComponent('oneCmp', {
|
||||
template: '<div>{{oneCmp.number}}</div>',
|
||||
controller: function () {this.number = 'one'}
|
||||
controller: function () {this.number = 'one';}
|
||||
});
|
||||
registerComponent('twoCmp', {
|
||||
template: '<div><a ng-link="[\'/Two\']">{{twoCmp.number}}</a></div>',
|
||||
controller: function () {this.number = 'two'}
|
||||
controller: function () {this.number = 'two';}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -37,15 +37,15 @@ describe('navigation', function () {
|
||||
});
|
||||
registerDirective('oneCmp', {
|
||||
template: '<div>{{oneCmp.number}}</div>',
|
||||
controller: function () {this.number = 'one'}
|
||||
controller: function () {this.number = 'one';}
|
||||
});
|
||||
registerDirective('twoCmp', {
|
||||
template: '<div>{{twoCmp.number}}</div>',
|
||||
controller: function () {this.number = 'two'}
|
||||
controller: function () {this.number = 'two';}
|
||||
});
|
||||
registerComponent('threeCmp', {
|
||||
template: '<div>{{$ctrl.number}}</div>',
|
||||
controller: function () {this.number = 'three'}
|
||||
controller: function () {this.number = 'three';}
|
||||
});
|
||||
registerComponent('getParams', {
|
||||
template: '<div>{{$ctrl.params.x}}</div>',
|
||||
@ -54,7 +54,7 @@ describe('navigation', function () {
|
||||
this.params = next.params;
|
||||
};
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('should work in a simple case', function () {
|
||||
@ -331,7 +331,7 @@ describe('navigation', function () {
|
||||
var definition = {
|
||||
template: options.template || '',
|
||||
controller: getController(options),
|
||||
}
|
||||
};
|
||||
applyStaticProperties(definition.controller, options);
|
||||
$compileProvider.component(name, definition);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ describe('router', function () {
|
||||
expect(homeElement.text()).toBe('Home');
|
||||
expect(homeElement.isolateScope().$ctrl.$router).toBeDefined();
|
||||
expect(router).toBeDefined();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('should work when an async route is provided route data', function() {
|
||||
@ -126,7 +126,7 @@ describe('router', function () {
|
||||
var homeElement = elt.find('home-cmp');
|
||||
expect(homeElement.text()).toBe('Home');
|
||||
expect($routerOnActivate).toHaveBeenCalled();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('should provide the current instruction', function() {
|
||||
|
8
modules/angular1_router/test/ng_link_spec.js
vendored
8
modules/angular1_router/test/ng_link_spec.js
vendored
@ -64,7 +64,7 @@ describe('ngLink', function () {
|
||||
|
||||
it('should allow params in routerLink directive', function () {
|
||||
setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix});
|
||||
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: \'lol\'}]">{{twoLinkCmp.number}}</a></div>', function () {this.number = 'two'});
|
||||
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: \'lol\'}]">{{twoLinkCmp.number}}</a></div>', function () {this.number = 'two';});
|
||||
configureRouter([
|
||||
{ path: '/a', component: 'twoLinkCmp' },
|
||||
{ path: '/b/:param', component: 'twoCmp', name: 'Two' }
|
||||
@ -78,7 +78,7 @@ describe('ngLink', function () {
|
||||
|
||||
it('should update the href of links with bound params', function () {
|
||||
setup({baseHref: baseHref, html5Mode: html5Mode, hashPrefix: hashPrefix});
|
||||
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: $ctrl.number}]">{{$ctrl.number}}</a></div>', function () {this.number = 43});
|
||||
registerComponent('twoLinkCmp', '<div><a ng-link="[\'/Two\', {param: $ctrl.number}]">{{$ctrl.number}}</a></div>', function () {this.number = 43;});
|
||||
configureRouter([
|
||||
{ path: '/a', component: 'twoLinkCmp' },
|
||||
{ path: '/b/:param', component: 'twoCmp', name: 'Two' }
|
||||
@ -184,8 +184,8 @@ describe('ngLink', function () {
|
||||
$locationProvider.hashPrefix(config.hashPrefix);
|
||||
});
|
||||
registerComponent('userCmp', '<div>hello {{$ctrl.$routeParams.name}}</div>', function () {});
|
||||
registerComponent('oneCmp', '<div>{{$ctrl.number}}</div>', function () {this.number = 'one'});
|
||||
registerComponent('twoCmp', '<div><a ng-link="[\'/Two\']">{{$ctrl.number}}</a></div>', function () {this.number = 'two'});
|
||||
registerComponent('oneCmp', '<div>{{$ctrl.number}}</div>', function () {this.number = 'one';});
|
||||
registerComponent('twoCmp', '<div><a ng-link="[\'/Two\']">{{$ctrl.number}}</a></div>', function () {this.number = 'two';});
|
||||
}
|
||||
|
||||
function configureRouter(routeConfig) {
|
||||
|
@ -83,6 +83,6 @@ function provideHelpers(fn, preInject) {
|
||||
$rootRouter: $rootRouter,
|
||||
put: put,
|
||||
compile: compile
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user