mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #5147 from chrismbarr/patch-7
UI-Router: The templateUrl accepts one parameter
This commit is contained in:
@@ -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', {
|
||||
|
||||
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user