cf8b0fb9
Nung Poti
template master
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/**
* Created by Develop-SC on 1/7/2559.
*/
/**
* Created by Develop-SC on 30/6/2559.
*/
angular.module('Item', [])
.controller('CtrlItem', ['$scope', '$http', function($scope, $http) {
$scope.addItems = function(username,macaddr) {
//var conCheck = confirm(' คุณแน่ใจว่าหรือไม่ว่าจะเพิ่ม \n\n Username : '+$scope.contact.username+'\n Mac Address : '+$scope.contact.macaddr);
var conCheck = true;
if(conCheck){
$scope.checkBtn = false;
$http.post(host+'/api/items', $scope.contact).success(function(response) {
$scope.contactlist = response;
console.log(response);
$scope.checkBtn = false;
if(response.resultCode == 20000){
$scope.success = true;
$scope.fail = false;
}else{
$scope.success = false;
$scope.fail = true;
}
});
}
};
}]);
|