forked from rsaudubr/Virtual_Visual_WebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.js
39 lines (28 loc) · 1 KB
/
services.js
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
30
31
32
33
34
35
36
37
38
39
/*angular.module('starter.services', [])
.factory('IBeacon', function($timeout){
loadBeacons = function(){
console.log('ici, c\'est mieux ');
var luuid = '', lidentifier = '', lminor = '', lmajor = '', ltxCalibrated = '';
var req = new XMLHttpRequest();
req.open("GET", "iBeacons.json", true);
req.onreadystatechange = readJson;
req.send(null);
var doc ='';
function readJson(){
if (req.readyState == 4) {
doc = eval('(' + req.responseText + ')');
for (var i = 0; i < 2; i++) {
console.log('value of uuid : ' + doc.iBeacons[0].identifier)
var identifier = document.getElementById('identifier1');
console.log('identifier cellule : ' +identifier.innerhtml)
identifier.innerhtml = doc.iBeacons[0].identifier;
};
console.log('value of identifier : ' + doc.iBeacons[1].identifier);
};
}
};
return {
loadBeacons:loadBeacons
}
});
*/