mettre les private pour la classe network coté serveur et mes premières essaie pour angularjs notamement extraction des donnée
This commit is contained in:
parent
804fa322d8
commit
750dcc61ce
4 changed files with 76 additions and 22 deletions
19
client/Test/index.html
Normal file
19
client/Test/index.html
Normal file
|
@ -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>
|
27
client/js/services/Network.js
Normal file
27
client/js/services/Network.js
Normal file
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}]);
|
||||
|
||||
|
8
client/js/services/Test.js
Normal file
8
client/js/services/Test.js
Normal file
|
@ -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;
|
||||
});
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue