The screenshot of the code is as above. What is the data in it used for? I’d like to thank all the masters for your advice
淡淡烟草味2017-05-15 17:15:33
Official document address
https://ui-router.github.io/n...$stateProvider
Explanation about the data of $stateProvider.state
Arbitrary data object, useful for custom configuration. The parent state's data is prototypally inherited. In other words, adding a data property to a state adds it to the entire subtree via prototypal inheritance.
Machine translation
Arbitrary data object, suitable for custom configuration. The data of the parent state is prototypically inherited. In other words, adding a data attribute to a state adds it to the entire subtree via prototypal inheritance.
Simply put, it is a custom configuration of routing. You can get this value as a parameter in the controller
世界只因有你2017-05-15 17:15:33
function Ctrl($state){
console.log($state.current.data.status) // outputs "1";
}