angular.js - angular state configuration problem
PHP中文网
PHP中文网 2017-05-15 17:13:33
0
2
608


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

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
淡淡烟草味

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

世界只因有你
function Ctrl($state){
    console.log($state.current.data.status) // outputs "1";
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template