I'm trying to get the userlist [master] and user details[detail] on the same page.
https://plnkr.co/edit/EKY2pztGkKXUuQIyefUY?p=preview
module and configuration.
var myModule = angular.module("myApp", ['ui.router']);
myModule.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('user', {
url : '/users',
templateUrl:'users.html',
controller : 'usersController'
})
.state('user.details', {
url : '/:id',
templateUrl:'users.html',
controller : 'usersControllerDetail'
});
$urlRouterProvider.otherwise("/users");
});
myModule.controller('usersController' , function($scope){
$scope.users = [{username : 'manish', id : 1}, { username : 'kaustubh', id :2} ]
});
myModule.controller('usersControllerDetail' , function($scope, $stateParams){
console.log($stateParams.id);
});
when ever I click on the user in the master list , master list is rendered twice on scree.
can you please let me know where I'm going wrong