You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }]);