Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. state: 'mdm.entity',
  2. config: {
  3. url: '/entity/{id}',
  4. templateUrl: 'app/views/entity.html',
  5. data: {
  6. name: 'ENTITY'
  7. },
  8. resolve: {
  9. entity: ['$stateParams', '$http',
  10. function ($stateParams, $http) {
  11. return $http.get('entity', {
  12. params: {
  13. id: $stateParams.id
  14. }
  15. })
  16. .then(function (res) {
  17. // res.name => 'Special Thing'
  18. return res;
  19. });
  20. }]
  21. }
  22. }
  23.  
  24. .then(function (res) {
  25. // res.name => 'Special Thing'
  26. $stateParams.name = res.name;
  27. return res;
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement