Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .state('test', {
- url: "/test",
- views:
- {
- "main":
- {
- templateUrl:"app/views/templates/test/test.php",
- controller:function($scope, $stateParams)
- {
- console.log("bum");
- console.log($stateParams.id); //this is undefined even if i have it defined!
- }
- }
- }
- })
- .state('test.id',
- {
- url:"/{id}",
- views:{
- "main":{
- templateUrl:"app/views/templates/test/testOverWritten.php",
- controller:function($scope, $stateParams)
- {
- console.log("main is overwritten");
- console.log($stateParams.id);
- }
- },
- "testLeft":
- {
- templateUrl:"app/views/templates/test/test.menu.php",
- controller:function($scope)
- {
- console.log("insantieted");
- }
- },
- "testContent":
- {
- templateUrl:"app/views/templates/test/test.content.php",
- controller:function($scope)
- {
- console.log("insantieted");
- }
- }
- }
- })
- <div class="row">
- <div class="col-md-8">
- <div ui-view="testContent">Original</div>
- </div>
- <div class="col-md-3">
- <div ui-view="testLeft">OrgMenu</div>
- </div>
- </div>
- .state('test.id',
- {
- url:"/{id}",
- views:{
- "main@":{
- templateUrl:"app/views/templates/test/layout2.php",
- controller:function($scope, $stateParams)
- {
- console.log("main is overwritten");
- console.log($stateParams.id);
- }
- },
- "testMenu@test.id":
- {
- templateUrl:"app/views/templates/test/test.menu.php",
- controller:function($scope)
- {
- console.log("instantieted");
- }
- },
- "testContent@test.id":
- {
- templateUrl:"app/views/templates/test/test.content.php",
- controller:function($scope)
- {
- console.log("instantieted");
- }
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement