Add tests

This commit is contained in:
Santi Albo
2014-01-28 14:53:09 +00:00
parent adcb4a09b3
commit 8867eb90b8

View File

@@ -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" }
}
});
});
});