diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/Test/index.html | 19 | ||||
| -rw-r--r-- | client/js/services/Network.js | 27 | ||||
| -rw-r--r-- | client/js/services/Test.js | 8 |
3 files changed, 54 insertions, 0 deletions
diff --git a/client/Test/index.html b/client/Test/index.html new file mode 100644 index 0000000..147745c --- /dev/null +++ b/client/Test/index.html @@ -0,0 +1,19 @@ +<head> + +<script src="../vendors/angularjs/angular.min.js"></script> + <script src="../vendors/angularjs/angular-route.min.js"></script> + <script src="../vendors/angularjs/angular-sanitize.min.js"></script> + <script src="../vendors/angularjs/angular-cookies.min.js"></script> + <script src="../js/services/Test.js"></script> + <script src="../js/app.js"></script> +</head> + +<body ng-app="mainApp"> + <div ng-controller="hassan"> + <ul> + <li ng-repeat="person in persons"> + {{person.Name + ' : ' + person.Age}} + </li> + </ul> + </div> +</body> diff --git a/client/js/services/Network.js b/client/js/services/Network.js new file mode 100644 index 0000000..bd2a24f --- /dev/null +++ b/client/js/services/Network.js @@ -0,0 +1,27 @@ + +mainApp.factory('Network',[ '$http', 'Identity', function($http, Identity){ + + var data={}; + data.networks=null; + +var ListId=function(fileToUpload, callback) { + + + var result=$http.post('../server/index.php', + $.param({"token" : Identity.getToken(), "task" : "network", 'action':'list_network_ids'})); + + // Wait and handle the response + result.then(function (response){ + callback(parseUploadImageAnswer(response, false)); + },function(response){ + callback(parseUploadImageAnswer(response, true)); + }); + + console.log(result) + + } + + +}]); + + diff --git a/client/js/services/Test.js b/client/js/services/Test.js new file mode 100644 index 0000000..f12c6b9 --- /dev/null +++ b/client/js/services/Test.js @@ -0,0 +1,8 @@ +var app = angular.module('mainApp',[]); +app.controller('hassan', function($scope,$http){ + $http.get('http://127.0.0.1/database.json').success(function(response){ + $scope.persons = response.records; +}); + + +}); |
