diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 7ceafacd3..a05f13dd8 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -50,7 +50,7 @@ myApp.config(( .state('state1.list', { url: "/list", templateUrl: "partials/state1.list.html", - controller: function ($scope: MyAppScope) { + controller: function ($scope: MyAppScope) { $scope.items = ["A", "List", "Of", "Items"]; } }) @@ -61,7 +61,7 @@ myApp.config(( .state('state2.list', { url: "/list", templateUrl: "partials/state2.list.html", - controller: function ($scope: MyAppScope) { + controller: function ($scope: MyAppScope) { $scope.things = ["A", "Set", "Of", "Things"]; } }) @@ -70,7 +70,14 @@ myApp.config(( url: "/list", templateUrl: "partials/state3.list.html", controller: function ($scope: MyAppScope) { - $scope.things = ["A", "Set", "Of", "Things"]; + $scope.things = ["A", "Set", "Of", "Things"]; + } + }) + .state('state4', { + url: "/state4", + templateUrl: function($stateParams: ng.ui.IStateParamsService){ + //Logic could go here based on $stateParams + return "partials/state4.html"; } }) .state('index', { diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 913655bd4..e35f22ee0 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -16,7 +16,7 @@ declare module angular.ui { /** * String URL path to template file OR Function, returns URL path string */ - templateUrl?: string | {(): string}; + templateUrl?: string | {(params: IStateParamsService): string}; /** * Function, returns HTML content string */ @@ -53,12 +53,12 @@ declare module angular.ui { 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 explictly annotate this function, because it won't be automatically annotated by your build tools. + * 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)[]; /** * 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 explictly annotate this function, because it won't be automatically annotated by your build tools. + * 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)[]; /** @@ -66,7 +66,7 @@ declare module angular.ui { */ data?: any; /** - * Boolean (default true). If false will not retrigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload. + * Boolean (default true). If false will not re-trigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload. */ reloadOnSearch?: boolean; }