From e37796c642232a220e5f063d4b8b9b9c3b3a7904 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Thu, 30 Jul 2015 13:34:47 -0400 Subject: [PATCH 1/5] templateUrl accepts one parameter docs: https://github.com/angular-ui/ui-router/wiki#templates --- angular-ui-router/angular-ui-router.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index ed2f36ccf..803b414ad 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 | {(IStateParamsService?): string}; /** * Function, returns HTML content string */ From 691392cfca3ea2d419fce9471a0439f7cfb28c51 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Thu, 30 Jul 2015 13:38:12 -0400 Subject: [PATCH 2/5] Spelling fixes --- angular-ui-router/angular-ui-router.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 803b414ad..c82fb51d6 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -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; } From 90551f00c5bc9a1b2c5a4a112a2db7d17dcb866f Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Thu, 30 Jul 2015 13:44:45 -0400 Subject: [PATCH 3/5] Updating tests --- angular-ui-router/angular-ui-router-tests.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index a43f9e9bc..6dae1c085 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', { From 6e43da89b9a2f0b8e4966d2fac4577bba526ea84 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Thu, 30 Jul 2015 13:49:48 -0400 Subject: [PATCH 4/5] Trying to fix CI build - maybe the ? is throwing it off? --- angular-ui-router/angular-ui-router.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index c82fb51d6..256342ea5 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 | {(IStateParamsService?): string}; + templateUrl?: string | {(IStateParamsService): string}; /** * Function, returns HTML content string */ From fb1410b421d11cd7b2b02fccd1ad1069526cbc56 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Thu, 30 Jul 2015 13:54:38 -0400 Subject: [PATCH 5/5] Oh right, I've gotta name the param and assign it a type! --- angular-ui-router/angular-ui-router.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 256342ea5..85bada50b 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 | {(IStateParamsService): string}; + templateUrl?: string | {(params: IStateParamsService): string}; /** * Function, returns HTML content string */