Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. .state('test', {
  2. url: "/test",
  3. views:
  4. {
  5. "main":
  6. {
  7. templateUrl:"app/views/templates/test/test.php",
  8. controller:function($scope, $stateParams)
  9. {
  10. console.log("bum");
  11. console.log($stateParams.id); //this is undefined even if i have it defined!
  12. }
  13. }
  14. }
  15.  
  16. })
  17. .state('test.id',
  18. {
  19. url:"/{id}",
  20. views:{
  21. "main":{
  22. templateUrl:"app/views/templates/test/testOverWritten.php",
  23. controller:function($scope, $stateParams)
  24. {
  25. console.log("main is overwritten");
  26. console.log($stateParams.id);
  27. }
  28. },
  29. "testLeft":
  30. {
  31. templateUrl:"app/views/templates/test/test.menu.php",
  32. controller:function($scope)
  33. {
  34. console.log("insantieted");
  35. }
  36. },
  37. "testContent":
  38. {
  39. templateUrl:"app/views/templates/test/test.content.php",
  40. controller:function($scope)
  41. {
  42. console.log("insantieted");
  43. }
  44. }
  45. }
  46. })
  47.  
  48. <div class="row">
  49. <div class="col-md-8">
  50. <div ui-view="testContent">Original</div>
  51. </div>
  52. <div class="col-md-3">
  53. <div ui-view="testLeft">OrgMenu</div>
  54. </div>
  55. </div>
  56.  
  57. .state('test.id',
  58. {
  59. url:"/{id}",
  60. views:{
  61. "main@":{
  62. templateUrl:"app/views/templates/test/layout2.php",
  63. controller:function($scope, $stateParams)
  64. {
  65. console.log("main is overwritten");
  66. console.log($stateParams.id);
  67. }
  68. },
  69. "testMenu@test.id":
  70. {
  71. templateUrl:"app/views/templates/test/test.menu.php",
  72. controller:function($scope)
  73. {
  74. console.log("instantieted");
  75. }
  76. },
  77. "testContent@test.id":
  78. {
  79. templateUrl:"app/views/templates/test/test.content.php",
  80. controller:function($scope)
  81. {
  82. console.log("instantieted");
  83. }
  84. }
  85. }
  86. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement