angular.module('harbinger').controller(
'Admin.UserlistController',
function($rootScope, $scope, $location, $http, userService)
{
// etc
$scope.gridOptions = {
// etc ,
enableRowSelection: false,
columnDefs: [
{field: 'userName', displayName: 'Username'},
{field: 'name', displayName: 'Name'},
{field: 'organization', displayName: 'Organization'},
{field: 'title', displayName: 'Title'},
{field: 'dateOfBirth', displayName: 'Date Of Birth'},
{field: 'controls', displayName: '', cellTemplate: '<div id="controls" ><a id="user-edit" onClick="editUser(\'{{row.entity.userName}}\')">Edit</a> | <a id="user-reset" data-ng-click="resetUser(\'{{row.entity.userName}}\')">Reset</a> | <a id="user-unlock">Un-lock</a></div>'}
]
};
onclick of user reset i have to pass the
userService.reset($scope.userData, function( data ) // success
{
// etc
}
i am using ngGrid, and i am trying to call a scope method from a button displayed in ngGrid. –
on click i am not able to execute this function . Please give me angular js way to do this .
ng-click()