mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add tests
This commit is contained in:
@@ -9,11 +9,21 @@ interface MyAppScope extends ng.IScope {
|
||||
|
||||
myApp.config((
|
||||
$stateProvider: ng.ui.IStateProvider,
|
||||
$urlRouterProvider: ng.ui.IUrlRouterProvider) => {
|
||||
//
|
||||
// For any unmatched url, redirect to /state1
|
||||
$urlRouterProvider.otherwise("/state1");
|
||||
//
|
||||
$urlRouterProvider: ng.ui.IUrlRouterProvider,
|
||||
$urlMatcherFactory: ng.ui.IUrlMatcherFactory) => {
|
||||
|
||||
var matcher: ng.ui.IUrlMatcher = $urlMatcherFactory.compile("/foo/:bar?param1");
|
||||
|
||||
$urlRouterProvider
|
||||
.when('/test', '/list')
|
||||
.when(/\/test\d/, ($injector: ng.auto.IInjectorService, $location: ng.ILocationService) => {
|
||||
return '/list';
|
||||
})
|
||||
.when(matcher, ['$injector', '$location', ($injector: ng.auto.IInjectorService, $location: ng.ILocationService) => {
|
||||
return false;
|
||||
}])
|
||||
.otherwise("/state1");
|
||||
|
||||
// Now set up the states
|
||||
$stateProvider
|
||||
.state('state1', {
|
||||
@@ -58,4 +68,4 @@ myApp.config((
|
||||
"viewB": { template: "route2.viewB" }
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user