|
@@ -0,0 +1,31 @@
|
|
1
|
+/**
|
|
2
|
+ * Created by robin on 11/4/15.
|
|
3
|
+ */
|
|
4
|
+
|
|
5
|
+angular.module('luticate')
|
|
6
|
+ .controller('GroupEditController', ['$scope', 'luticateAuthGroups', 'data',
|
|
7
|
+ function($scope, luticateAuthGroups, data) {
|
|
8
|
+ if (data != null) {
|
|
9
|
+ $scope.group = data;
|
|
10
|
+ }
|
|
11
|
+ else {
|
|
12
|
+ $scope.group = {
|
|
13
|
+ Name: ""
|
|
14
|
+ }
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ $scope.submitForm = function()
|
|
18
|
+ {
|
|
19
|
+ if ($scope.group.Id != null) {
|
|
20
|
+ return luticateAuthGroups.edit({
|
|
21
|
+ group_id: $scope.group.Id,
|
|
22
|
+ group_name: $scope.group.Name
|
|
23
|
+ });
|
|
24
|
+ }
|
|
25
|
+ else {
|
|
26
|
+ return luticateAuthGroups.add({
|
|
27
|
+ group_name: $scope.group.Name
|
|
28
|
+ });
|
|
29
|
+ }
|
|
30
|
+ }
|
|
31
|
+ }]);
|