filmov
tv
AngularJS ui router custom data

Показать описание
pass angular state custom data to controller
pass angular state custom data to view
ui router data property example
ui router custom data example
ui router read custom data from controller
In this video we will discuss how to add custom data to a state in angular.
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
To add custom data to a state use data property. In the example below, we have added a data a property to the "home" state. The value for this property is a Javascript object that contains our custom data. Along the same lines we have added custom data to the "courses" state.
$stateProvider
.state("home", {
url: "/home",
controller: "homeController",
controllerAs: "homeCtrl",
data: {
customData1: "Home State Custom Data 1",
customData2: "Home State Custom Data 2"
}
})
.state("courses", {
url: "/courses",
controller: "coursesController",
controllerAs: "coursesCtrl",
data: {
customData1: "Courses State Custom Data 1",
customData2: "Courses State Custom Data 2"
}
})
.controller("homeController", function ($state) {
})
[fieldset]
[legend]Home[/legend]
[br /]
[/fieldset]
[fieldset]
[legend]Courses[/legend]
[br /]
[/fieldset]
With all the above changes, the custom data will be displayed on the home view.
Link for all dot net and sql server video tutorial playlists
Link for slides, code samples and text version of the video
pass angular state custom data to view
ui router data property example
ui router custom data example
ui router read custom data from controller
In this video we will discuss how to add custom data to a state in angular.
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
To add custom data to a state use data property. In the example below, we have added a data a property to the "home" state. The value for this property is a Javascript object that contains our custom data. Along the same lines we have added custom data to the "courses" state.
$stateProvider
.state("home", {
url: "/home",
controller: "homeController",
controllerAs: "homeCtrl",
data: {
customData1: "Home State Custom Data 1",
customData2: "Home State Custom Data 2"
}
})
.state("courses", {
url: "/courses",
controller: "coursesController",
controllerAs: "coursesCtrl",
data: {
customData1: "Courses State Custom Data 1",
customData2: "Courses State Custom Data 2"
}
})
.controller("homeController", function ($state) {
})
[fieldset]
[legend]Home[/legend]
[br /]
[/fieldset]
[fieldset]
[legend]Courses[/legend]
[br /]
[/fieldset]
With all the above changes, the custom data will be displayed on the home view.
Link for all dot net and sql server video tutorial playlists
Link for slides, code samples and text version of the video
Комментарии