您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

cameras.controller.js 897B

123456789101112131415161718192021222324252627282930
  1. angular.module('camotion')
  2. .controller('CamerasController', ['$scope', 'CamerasService',
  3. function($scope, CamerasService) {
  4. $scope.cameras = [];
  5. $scope.rowCameras = [];
  6. $scope.playingCameras = [];
  7. $scope.playPause = function(camera)
  8. {
  9. var idx = $scope.playingCameras.indexOf(camera.Id);
  10. if (idx > -1) {
  11. $scope.playingCameras.splice(idx, 1);
  12. }
  13. else {
  14. $scope.playingCameras.push(camera.Id);
  15. }
  16. };
  17. $scope.isPlaying = function(camera)
  18. {
  19. return $scope.playingCameras.indexOf(camera.Id) > -1;
  20. };
  21. CamerasService.getAll({}).then(function(cameras)
  22. {
  23. $scope.cameras = cameras.Data;
  24. });
  25. }]);