When i click on view Button from department list Data not showing on view template. i am not using any service. please help me someone.........
my source code is given below ......
My Angularjs Controller:
.when('/Edit/:Id', {
templateUrl: baseSiteUrlPath + 'Templates/Hrm_dept/Edit.html',
controller: 'DeptCtrl'
})
DeptApp.controller('DeptCtrl', function ($scope, $routeParams, $location, $route) {
$scope.Dept = {};
$scope.Dept1 = {};
$scope.DeptList = [];
$scope.DeptList1 = [];
$scope.ishide = true;
$scope.DeptView = function (Dept) {
console.log(Dept);
**$scope.Dept1 = angular.copy(Dept);**
var id = 1;
**var earl = '/Edit/' + id;**
$location.path(earl);
$scope.$apply();
};
});
Here is My List Template: ng-click="DeptView(Dept)"
Here is My View Template: Dept Name: ng-model="Dept1.DEPT_NAME"
$scope.$apply()could probably be throwing an error