|
@@ -1,3 +1,25 @@
|
|
|
-angular.module('appMessage').controller('TransmitterController', ['$scope', function($scope) {
|
|
|
-
|
|
|
+angular.module('appMessage').controller('TransmitterController', ['$scope', '$timeout', function($scope, $timeout) {
|
|
|
+ $scope.transmitters = [];
|
|
|
+ $scope.reflesh = function(jsonStr){
|
|
|
+ console.log(jsonStr);
|
|
|
+ var arr = JSON.parse(jsonStr);
|
|
|
+
|
|
|
+ _.forEach(arr, function(value){
|
|
|
+ var isExist = false;
|
|
|
+ for(var i = 0; i < $scope.transmitters.length - 1; i++)
|
|
|
+ if (value.id = $scope.transmitters[i].id){
|
|
|
+ isExist = true;
|
|
|
+ _.assign($scope.transmitters[i], value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (!isExist)
|
|
|
+ $scope.transmitters.push(value);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ lxtalkClient.Invoke('{AFAF1B48-627D-48E0-B513-26A0CDF1EBD0}', '_Register', '', $scope);
|
|
|
+
|
|
|
+ $timeout(function(){
|
|
|
+ lxtalkClient.Invoke('{AFAF1B48-627D-48E0-B513-26A0CDF1EBD0}', 'Reflesh', '', $scope);
|
|
|
+ }, 3000);
|
|
|
+
|
|
|
}]);
|