Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- state: 'mdm.entity',
- config: {
- url: '/entity/{id}',
- templateUrl: 'app/views/entity.html',
- data: {
- name: 'ENTITY'
- },
- resolve: {
- entity: ['$stateParams', '$http',
- function ($stateParams, $http) {
- return $http.get('entity', {
- params: {
- id: $stateParams.id
- }
- })
- .then(function (res) {
- // res.name => 'Special Thing'
- return res;
- });
- }]
- }
- }
- .then(function (res) {
- // res.name => 'Special Thing'
- $stateParams.name = res.name;
- return res;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement