angular.module('luticate') .controller('TestController', ['$scope', 'luticateAuthUsers', function($scope, luticateAuthUsers) { $scope.luBasicTable = { columns: [ { name: "Username", width: 3, getValue: function (item) { return item.Username; } }, { name: "Email", width: 3, getValue: function (item) { return item.Email; } }, { name: "Firstname", width: 3, getValue: function (item) { return item.Firstname; } }, { name: "Lastname", width: 3, getValue: function (item) { return item.Lastname; } } ], canCheck: function() { return true; }, canClick: function() { return false; }, onItemClicked: function(item) { console.log(item); scope.toggleCheckedItem(item); }, onItemChecked: function(item, checked) { console.log(item, checked); }, getLoadPagePromise: function (page, perPage, query, promise) { return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise); } }; $scope.luEditTable = { columns: [ { name: "Username", width: 3, getValue: function (item) { return item.Username; } }, { name: "Email", width: 3, getValue: function (item) { return item.Email; } }, { name: "Firstname", width: 3, getValue: function (item) { return item.Firstname; } }, { name: "Lastname", width: 3, getValue: function (item) { return item.Lastname; } } ], onItemClicked: function(item) { console.log("edit clicked", item); }, onItemChecked: function(item, checked) { console.log("edit checked", item, checked); }, getLoadPagePromise: function (page, perPage, query, promise) { return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise); }, getDelPromise: function (id, promise) { return luticateAuthUsers.del({user_id: id}, promise); }, getEditController: function () { return "UserEdit"; }, onItemDeleted: function(item) { console.log("edit removed", item); }, onItemEdited: function(item) { console.log("edit edited", item); }, onItemAdded: function(item) { console.log("edit added", item); }, canDelete: 'LU_USER_DEL', canEdit: function() { return true; }, canAdd: function() { return true; } }; $scope.luUserPicker = { columns: [ { name: "Username", width: 3, getValue: function (item) { return item.Username; } }, { name: "Email", width: 3, getValue: function (item) { return item.Email; } }, { name: "Firstname", width: 3, getValue: function (item) { return item.Firstname; } }, { name: "Lastname", width: 3, getValue: function (item) { return item.Lastname; } } ], onItemClicked: function(item) { console.log("user clicked", item); }, onItemChecked: function(item, checked) { console.log("user checked", item, checked); }, getLoadPagePromise: function(page, perPage, query, promise) { return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise); }, onPageChanged: function() { console.log("user page", $scope.luUserPicker.page); }, getItemText: function(item) { return item.Username; } }; }]);