allow strictDi controller

This commit is contained in:
Paulo Cesar
2015-08-07 00:41:30 -03:00
parent b45569f35d
commit e8c8cfa1d4
2 changed files with 22 additions and 15 deletions
+8 -1
View File
@@ -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;
+14 -14
View File
@@ -26,24 +26,24 @@ declare module angular.ui {
/**
* Function, returns HTML content string
*/
templateProvider?: Function | Array<any>;
templateProvider?: Function | Array<string|Function>;
/**
* 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<string|Function>;
controllerAs?: string;
/**
* Function (injectable), returns the actual controller function or string.
*/
controllerProvider?: Function;
controllerProvider?: Function|Array<string|Function>;
/**
* 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<string|Function>;
/**
* 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<string|Function>;
/**
* 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: {
/**