mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
- Move angular-ui definitions to its own folder - Add self to readme - Add some tests for angular-ui-router
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
/// <reference path="angular-ui-router.d.ts" />
|
|
|
|
var myApp = angular.module('testModule');
|
|
|
|
|
|
myApp.config((
|
|
$stateProvider: ng.ui.IStateProvider,
|
|
$urlRouterProvider: ng.ui.IUrlRouterProvider) => {
|
|
//
|
|
// For any unmatched url, redirect to /state1
|
|
$urlRouterProvider.otherwise("/state1");
|
|
//
|
|
// Now set up the states
|
|
$stateProvider
|
|
.state('state1', {
|
|
url: "/state1",
|
|
templateUrl: "partials/state1.html"
|
|
})
|
|
.state('state1.list', {
|
|
url: "/list",
|
|
templateUrl: "partials/state1.list.html",
|
|
controller: function($scope) {
|
|
$scope.items = ["A", "List", "Of", "Items"];
|
|
}
|
|
})
|
|
.state('state2', {
|
|
url: "/state2",
|
|
templateUrl: "partials/state2.html"
|
|
})
|
|
.state('state2.list', {
|
|
url: "/list",
|
|
templateUrl: "partials/state2.list.html",
|
|
controller: function($scope) {
|
|
$scope.things = ["A", "Set", "Of", "Things"];
|
|
}
|
|
}).state('index', {
|
|
url: "",
|
|
views: {
|
|
"viewA": { template: "index.viewA" },
|
|
"viewB": { template: "index.viewB" }
|
|
}
|
|
})
|
|
.state('route1', {
|
|
url: "/route1",
|
|
views: {
|
|
"viewA": { template: "route1.viewA" },
|
|
"viewB": { template: "route1.viewB" }
|
|
}
|
|
})
|
|
.state('route2', {
|
|
url: "/route2",
|
|
views: {
|
|
"viewA": { template: "route2.viewA" },
|
|
"viewB": { template: "route2.viewB" }
|
|
}
|
|
});
|
|
}); |