add angular-ui-router-uib-modal definition and test

This commit is contained in:
Stepan Riha
2016-10-11 13:02:03 -05:00
parent 0329b1b8a6
commit fa33dffb3f
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
/// <reference path="./angular-ui-router-uib-modal.d.ts" />
angular.module("test", [
"ui.bootstrap",
"ui.router",
"ui.router.default"
])
.config(function($stateProvider: angular.ui.IStateProvider) {
$stateProvider
.state('contacts', {
// no modal
resolve: {
a: function() {
return "a";
},
b: function() {
return ["a", "b"];
}
}
})
.state('contacts.contact', {
// boolean modal
modal: true
})
.state('contacts.contact.edit', {
// string[] modal
modal: ["a", "b"]
})
;
});

View File

@@ -0,0 +1,12 @@
// Type definitions for angular-ui-uib-modal 0.11+ (ui.router module)
// Project: https://github.com/nonplus/angular-ui-router-uib-modal
// Definitions by: Stepan Riha <https://github.com/nonplus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
declare namespace angular.ui {
interface IState {
modal?: boolean | string[];
}
}