diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index a05f13dd8..ae4a8d7e5 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -54,6 +54,13 @@ myApp.config(( $scope.items = ["A", "List", "Of", "Items"]; } }) + .state('state1.list', { + url: "/list", + templateUrl: "partials/state1.list.html", + controller: ['$scope', function ($scope: MyAppScope) { + $scope.items = ["A", "List", "Of", "Items"]; + }] + }) .state('state2', { url: "/state2", templateUrl: "partials/state2.html" @@ -155,7 +162,7 @@ class UrlLocatorTestService implements IUrlLocatorTestService { this.$state.get("myState"); this.$state.get(); this.$state.reload(); - + // Accesses the currently resolved values for the current state // http://stackoverflow.com/questions/28026620/is-there-a-way-to-access-resolved-state-dependencies-besides-injecting-them-into/28027023#28027023 var resolvedValues = this.$state.$current.locals.globals; diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 10b92db7d..4a70579a9 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -26,24 +26,24 @@ declare module angular.ui { /** * Function, returns HTML content string */ - templateProvider?: Function | Array; + templateProvider?: Function | Array; /** - * A controller paired to the state. Function OR name as String + * A controller paired to the state. Function, annotated array or name as String */ - controller?: Function | string; + controller?: Function|string|Array; controllerAs?: string; /** * Function (injectable), returns the actual controller function or string. */ - controllerProvider?: Function; - + controllerProvider?: Function|Array; + /** * Specifies the parent state of this state */ - parent?: string | IState - - - resolve?: {}; + parent?: string | IState; + + + resolve?: { [name:string]: any }; /** * A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. */ @@ -55,18 +55,18 @@ declare module angular.ui { /** * Use the views property to set up multiple views. If you don't need multiple views within a single state this property is not needed. Tip: remember that often nested views are more useful and powerful than multiple sibling views. */ - views?: {}; + views?: { [name:string]: IState }; abstract?: boolean; /** * Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog. * If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools. */ - onEnter?: Function|(string|Function)[]; + onEnter?: Function|Array; /** * Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog. * If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools. */ - onExit?: Function|(string|Function)[]; + onExit?: Function|Array; /** * Arbitrary data object, useful for custom configuration. */ @@ -174,10 +174,10 @@ declare module angular.ui { current: IState; params: IStateParamsService; reload(): void; - + $current: IResolvedState; } - + interface IResolvedState { locals: { /**