AngularJS, STOMP client.
authorgustavo <gu.martinm@gmail.com>
Fri, 1 Apr 2016 00:51:57 +0000 (02:51 +0200)
committergustavo <gu.martinm@gmail.com>
Fri, 1 Apr 2016 00:51:57 +0000 (02:51 +0200)
19 files changed:
angularjs/stomp/karma.conf.js
angularjs/stomp/src/stomp/app/app.module.js
angularjs/stomp/src/stomp/app/example/example.controller.js [new file with mode: 0644]
angularjs/stomp/src/stomp/app/example/example.html [new file with mode: 0644]
angularjs/stomp/src/stomp/app/example/example.module.js [new file with mode: 0644]
angularjs/stomp/src/stomp/app/example/example.route.js [new file with mode: 0644]
angularjs/stomp/src/stomp/app/example/example.route.spec.js [new file with mode: 0644]
angularjs/stomp/src/stomp/app/users/users-child.controller.js [deleted file]
angularjs/stomp/src/stomp/app/users/users-child.controller.spec.js [deleted file]
angularjs/stomp/src/stomp/app/users/users-second-child.controller.js [deleted file]
angularjs/stomp/src/stomp/app/users/users-second-child.controller.spec.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.constants.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.controller.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.controller.spec.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.html [deleted file]
angularjs/stomp/src/stomp/app/users/users.module.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.route.js [deleted file]
angularjs/stomp/src/stomp/app/users/users.route.spec.js [deleted file]
angularjs/stomp/src/stomp/index.html

index 15ca427..045f1f4 100644 (file)
@@ -30,6 +30,8 @@ module.exports = function(config) {
       'bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
       'bower_components/angular-translate/angular-translate.js',
       'bower_components/angular-ui-router/release/angular-ui-router.js',
+      'bower_components/sockjs/sockjs.js',
+      'bower_components/stomp-websocket/lib/stomp.min.js',
       'bower_components/angular-mocks/angular-mocks.js',
       'bower_components/marked/lib/marked.js',
       //endbower
index cb17c0b..d89cc71 100644 (file)
@@ -7,8 +7,7 @@
    * @name app
    *
    * @requires app.core
-   * @requires app.welcome
-   * @requires app.cars
+   * @requires app.users
    *
    * @description
    * # app
@@ -21,7 +20,7 @@
     'app.core',
 
     /* Feature areas */
-    'app.users'
+    'app.example'
   ]);
 
 }());
diff --git a/angularjs/stomp/src/stomp/app/example/example.controller.js b/angularjs/stomp/src/stomp/app/example/example.controller.js
new file mode 100644 (file)
index 0000000..79929cb
--- /dev/null
@@ -0,0 +1,44 @@
+(function () {
+  'use strict';
+
+  angular
+    .module('app.users')
+    .controller('ExampleController', ExampleController);
+
+  /**
+   * @ngdoc controller
+   * @name app.example.controller:ExampleController
+   *
+   * @requires $rootScope
+   * @requires $scope
+   *
+   * <p>
+   * <br>
+   * {@link https://docs.angularjs.org/api/ng/service/$rootScope $rootScope}
+   * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope}
+   * </p>
+   *
+   * @description
+   * ExampleController controller.
+   */
+  /* @ngInject */
+  function ExampleController() {
+    var vm = this;
+
+    vm.connectHeaders = {};
+    vm.clientDestination = {};
+    vm.serverDestination = {};
+    vm.payload = {};
+    vm.headers = {};
+
+    vm.connect = function () {
+    };
+
+    vm.subscribe = function () {
+    };
+
+    vm.send = function () {
+    };
+  }
+
+})();
diff --git a/angularjs/stomp/src/stomp/app/example/example.html b/angularjs/stomp/src/stomp/app/example/example.html
new file mode 100644 (file)
index 0000000..ea77b29
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <meta charset="UTF-8">
+  <title>STOMP-Example</title>
+</head>
+<body class="ng-scope" ng-app="stomp-ui" ng-controller="ExampleController as vm">
+
+<div class="sidebar">
+  <div class="box">
+    <span class="up">1. Connect</span>
+    <button class="up-right" ng-click="vm.connect()">Connect to Endpoint</button>
+
+    <label>
+      Endpoint:
+      <input value="http://localhost:8080" class="ng-pristine ng-untouched ng-valid" ng-model="vm.url" placeholder="url">
+    </label>
+    <hr>
+    <label>
+      Headers:
+      <textarea class="ng-pristine ng-valid ng-touched" ng-model="vm.connectHeaders" placeholder="headers">
+        {"login":"superadmin","passcode":"12345678"}
+      </textarea>
+    </label>
+  </div>
+  <div class="box">
+    <span class="up">2. Subscribe</span>
+    <button class="up-right" ng-click="vm.subscribe()">Subscribe to destination</button>
+
+    <label>
+      Queue:
+      <input value="/rpc/" class="ng-pristine ng-untouched ng-valid" ng-model="vm.clientDestination"
+             placeholder="Client-Destination">
+    </label><br>
+  </div>
+  <div class="box">
+    <span class="up">3. Send</span>
+    <button class="up-right" ng-click="vm.send()">Send message to server</button>
+
+    <label>
+      Server-Destination:
+      <input value="/dest" class="ng-pristine ng-untouched ng-valid" ng-model="vm.serverDestination" placeholder="channel">
+    </label>
+    <hr>
+    <label>
+      Body / Payload
+      <textarea ng-model="vm.payload" size="50" class="full ng-pristine ng-untouched ng-valid" placeholder="payload">
+        {"key":"value"}
+      </textarea>
+    </label>
+    <hr>
+    <label>
+      Headers
+      <textarea ng-model="vm.headers" size="50" class="full ng-pristine ng-untouched ng-valid" placeholder="headers">
+        {"rid": 1234}
+      </textarea>
+    </label>
+  </div>
+
+</div>
+
+<textarea id="log"></textarea>
+
+</body>
+
+</html>
diff --git a/angularjs/stomp/src/stomp/app/example/example.module.js b/angularjs/stomp/src/stomp/app/example/example.module.js
new file mode 100644 (file)
index 0000000..e5a44f7
--- /dev/null
@@ -0,0 +1,20 @@
+(function() {
+  'use strict';
+
+  /**
+   * @ngdoc overview
+   * @name app.example
+   *
+   * @requires app.core
+   *
+   * @description
+   * # app.example
+   *
+   * ## Module STOMP example.
+   * STOMP example
+   */
+  angular.module('app.example', [
+    'app.core'
+  ]);
+
+})();
diff --git a/angularjs/stomp/src/stomp/app/example/example.route.js b/angularjs/stomp/src/stomp/app/example/example.route.js
new file mode 100644 (file)
index 0000000..ff592d7
--- /dev/null
@@ -0,0 +1,37 @@
+(function() {
+  'use strict';
+
+  angular
+    .module('app.example')
+    .config(route);
+
+  /**
+   * @ngdoc service
+   * @name app.example.route
+   *
+   * @requires $stateProvider
+   * @requires $urlRouterProvider
+   *
+   * <p>
+   * <br>
+   * {@link http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$stateProvider $stateProvider} <br>
+   * {@link http://angular-ui.github.io/ui-router/site/#/api/ui.router.router.$urlRouterProvider $urlRouterProvider}
+   * </p>
+   *
+   *
+   * @description
+   * Router configuration for example application.
+   */
+  /* @ngInject */
+  function route($stateProvider, $urlRouterProvider) {
+    var state = 'example';
+    var config = {
+      abstract: false,
+      url: '/example',
+      templateUrl: 'app/example/example.html'
+    };
+
+    $urlRouterProvider.otherwise(state);
+    $stateProvider.state(state, config);
+  }
+}());
diff --git a/angularjs/stomp/src/stomp/app/example/example.route.spec.js b/angularjs/stomp/src/stomp/app/example/example.route.spec.js
new file mode 100644 (file)
index 0000000..4da117f
--- /dev/null
@@ -0,0 +1,24 @@
+describe('app.example', function() {
+  'use strict';
+
+  describe('state', function() {
+    var view = {
+      example: 'app/example/example.html'
+    };
+    var $state;
+
+    beforeEach(function() {
+      module('app.example');
+
+      inject(function(_$state_) {
+        $state = _$state_;
+      });
+    });
+
+    it('should map /example route to users View template', function() {
+      expect($state.get('example').templateUrl).toEqual(view.example);
+    });
+
+  });
+
+});
diff --git a/angularjs/stomp/src/stomp/app/users/users-child.controller.js b/angularjs/stomp/src/stomp/app/users/users-child.controller.js
deleted file mode 100644 (file)
index bb1836c..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-(function () {
-  'use strict';
-
-  angular
-    .module('app.users')
-    .controller('UsersChildController', UsersChildController);
-
-  /**
-   * @ngdoc controller
-   * @name app.users.controller:UsersChildController
-   *
-   * @requires $rootScope
-   * @requires $scope
-   *
-   * <p>
-   * <br>
-   * {@link https://docs.angularjs.org/api/ng/service/$rootScope $rootScope}
-   * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope}
-   * </p>
-   *
-   * @description
-   * UsersChildController controller.
-   */
-  /* @ngInject */
-  function UsersChildController($rootScope, $scope, USERS) {
-    var vm = this;
-
-    var emitFact = {
-      title: 'Snake and Scarlett',
-      fact: 'it is canon'
-    };
-    var scopeBroadcastToSecondChild = {
-      name: 'UsersChild To UsersSecondChild',
-      lastName: 'scope broadcasting to UsersSecondChild from UserChild',
-      city: 'UserChild'
-    };
-    var rootScopeBroadcastToSecondChild = {
-      name: 'UsersChild To UsersSecondChild',
-      lastName: 'rootscope broadcasting to UsersSecondChild from UserChild',
-      city: 'UserChild'
-    };
-
-    // This is the right way for accessing to a parent controller from a child one when using the "Controller as" way.
-    // Problem: we need to name our controllers with something different to the "vm standard", otherwise
-    // here we wouldn't be able to access to the parent controller because it would have the same name as our child
-    // controller (vm). So, we need different names for parent and child controllers.
-    vm.valueForChildControllers = $scope.usersController.toBeCalledFromChildControllers();
-
-    vm.getEmit = function () {
-      $scope.$emit(USERS.SCOPE.EMIT_FACT, emitFact);
-    };
-    vm.broadcastToSencondChild = function () {
-      // $scope.$broadcast will never be seen by controllers in the same level as this controller. :(
-      $scope.$broadcast(USERS.SCOPE.BROADCAST_TO_SENCONDCHILD, scopeBroadcastToSecondChild);
-      // The only way is either using $rootScope or creating a new controllers hierarchy where
-      // UsersSecondChildController would be in a lower level than UsersChildController.
-      $rootScope.$broadcast(USERS.ROOTSCOPE.BROADCAST_TO_SENCONDCHILD, rootScopeBroadcastToSecondChild);
-    };
-    vm.usersChildOnScopeBroadcast = function (events, broadcastUser) {
-      vm.broadcastUser = broadcastUser;
-      console.log('usersChildOnScopeBroadcast, events.name: ' + events.name);
-    };
-
-    // NEVER USE $rootScope.$on IN CONTROLLER BECAUSE IT IS NOT DESTROYED EVEN IF CONTROLLER WAS DESTROYED!!!
-    // YOU WILL END UP HAVING AS MANY EVENT LISTENERS AS TIMES THIS CONTROLLER IS CREATED!!!!
-    // $rootScope.$on(USERS.ROOTSCOPE.BROADCAST, usersChildOnRootBroadcast);
-
-    // LISTENING FOR EVENTS IN $scope IS THE RIGHT THING BECAUSE THESE EVENT LISTENERS ARE DESTROYED
-    // AT THE SAME TIME AS THIS CONTROLLER :)
-    $scope.$on(USERS.ROOTSCOPE.BROADCAST, vm.usersChildOnScopeBroadcast);
-
-    // function usersChildOnRootBroadcast(events, broadcastUser) {
-    //   vm.broadcastUser = broadcastUser;
-    //   console.log('usersChildOnRootBroadcast, events.name: ' + events.name);
-    // }
-
-  }
-})();
diff --git a/angularjs/stomp/src/stomp/app/users/users-child.controller.spec.js b/angularjs/stomp/src/stomp/app/users/users-child.controller.spec.js
deleted file mode 100644 (file)
index 2b5faeb..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-describe('app.users', function() {
-  'use strict';
-
-  var valueForChildControllers = {
-    variable: 'This is a variable from UsersController',
-    value: 'Hello child controller'
-  };
-  var usersController = {
-    toBeCalledFromChildControllers: function() {
-      return valueForChildControllers;
-    }
-  };
-  var $rootScope;
-  var $scope;
-  var USERS;
-  var UsersChildController;
-
-  beforeEach(function() {
-    module('app.users');
-
-    inject(function($controller, _$rootScope_, _USERS_) {
-      $rootScope = _$rootScope_;
-      USERS = _USERS_;
-      $scope = $rootScope.$new();
-
-      $scope.usersController = usersController;
-      spyOn($scope, '$emit');
-      spyOn($rootScope, '$broadcast');
-      jasmine.createSpy($scope, '$scope.$broadcast');
-      spyOn($scope.usersController, 'toBeCalledFromChildControllers')
-        .and.callThrough();
-      UsersChildController = $controller('UsersChildController', {
-        $rootScope: $rootScope,
-        $scope: $scope,
-        USERS: _USERS_
-      });
-    });
-  });
-
-  describe('UsersChildController', function () {
-
-    it('should be created successfully', function () {
-      expect(UsersChildController).toBeDefined();
-
-      expect($scope.usersController.toBeCalledFromChildControllers).toHaveBeenCalled();
-      expect(UsersChildController.valueForChildControllers).toEqual(valueForChildControllers);
-    });
-
-    it('should be called $scope.$emit', function () {
-      var emitFact = {
-        title: 'Snake and Scarlett',
-        fact: 'it is canon'
-      };
-
-      UsersChildController.getEmit();
-
-      expect($scope.$emit).toHaveBeenCalledWith(USERS.SCOPE.EMIT_FACT, emitFact);
-    });
-
-    it('should be assigned broadcastUser', function () {
-      var rootScopeBroadcastUser = {
-        name: 'Snake',
-        lastName: 'Eyes',
-        city: 'classified'
-      };
-      var event = {
-        name: USERS.ROOTSCOPE.BROADCAST
-      };
-
-      UsersChildController.usersChildOnScopeBroadcast(event, rootScopeBroadcastUser);
-
-      expect(UsersChildController.broadcastUser).toEqual(rootScopeBroadcastUser);
-    });
-
-    it('should be called $rootScope.$broadcast', function () {
-      var scopeBroadcastToSecondChild = {
-        name: 'UsersChild To UsersSecondChild',
-        lastName: 'scope broadcasting to UsersSecondChild from UserChild',
-        city: 'UserChild'
-      };
-      var rootScopeBroadcastToSecondChild = {
-        name: 'UsersChild To UsersSecondChild',
-        lastName: 'rootscope broadcasting to UsersSecondChild from UserChild',
-        city: 'UserChild'
-      };
-
-      UsersChildController.broadcastToSencondChild();
-
-      expect($rootScope.$broadcast).toHaveBeenCalledWith(
-        USERS.ROOTSCOPE.BROADCAST_TO_SENCONDCHILD, rootScopeBroadcastToSecondChild);
-      expect($scope.$broadcast).toHaveBeenCalledWith(
-        USERS.SCOPE.BROADCAST_TO_SENCONDCHILD, scopeBroadcastToSecondChild);
-    });
-
-  });
-
-});
diff --git a/angularjs/stomp/src/stomp/app/users/users-second-child.controller.js b/angularjs/stomp/src/stomp/app/users/users-second-child.controller.js
deleted file mode 100644 (file)
index c4bb43d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-(function () {
-  'use strict';
-
-  angular
-    .module('app.users')
-    .controller('UsersSecondChildController', UsersSecondChildController);
-
-  /**
-   * @ngdoc controller
-   * @name app.users.controller:UsersSecondChildController
-   *
-   * @requires $scope
-   *
-   * <p>
-   * <br>
-   * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope}
-   * </p>
-   *
-   * @description
-   * UsersSecondChildController controller.
-   */
-  /* @ngInject */
-  function UsersSecondChildController($scope, USERS) {
-    var vm = this;
-
-    vm.usersSecondChildOnRootScopeBroadcast = function (events, rootScopeBroadcastUser) {
-      vm.rootScopeBroadcastUser = rootScopeBroadcastUser;
-      console.log('usersSecondChildOnRootScopeBroadcast, events.name: ' + events.name);
-    };
-    vm.usersSecondChildOnScopeBroadcast = function (events, scopeBroadcastUser) {
-      vm.scopeBroadcastUser = scopeBroadcastUser;
-      // You will never see this message because listening for $scope.$broadcast sent by
-      // controllers in the same level does not work.
-      console.log('usersSecondChildOnScopeBroadcast, events.name: ' + events.name);
-    };
-
-    $scope.$on(USERS.ROOTSCOPE.BROADCAST_TO_SENCONDCHILD, vm.usersSecondChildOnRootScopeBroadcast);
-
-    $scope.$on(USERS.SCOPE.BROADCAST_TO_SENCONDCHILD, vm.usersSecondChildOnScopeBroadcast);
-
-  }
-})();
diff --git a/angularjs/stomp/src/stomp/app/users/users-second-child.controller.spec.js b/angularjs/stomp/src/stomp/app/users/users-second-child.controller.spec.js
deleted file mode 100644 (file)
index 0b6f18d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-describe('app.users', function() {
-  'use strict';
-
-  var $rootScope;
-  var $scope;
-  var USERS;
-  var UsersSecondChildController;
-
-  beforeEach(function() {
-    module('app.users');
-
-    inject(function($controller, _$rootScope_, _USERS_) {
-      $rootScope = _$rootScope_;
-      USERS = _USERS_;
-      $scope = $rootScope.$new();
-
-      spyOn($scope, '$emit');
-      UsersSecondChildController = $controller('UsersSecondChildController', {
-        $rootScope: $rootScope,
-        $scope: $scope,
-        USERS: _USERS_
-      });
-    });
-  });
-
-  describe('UsersSecondChildController', function () {
-
-    it('should be created successfully', function () {
-      expect(UsersSecondChildController).toBeDefined();
-    });
-
-    it('should be assigned rootScopeBroadcastUser', function () {
-      var rootScopeBroadcastUser = {
-        name: 'UsersChild To UsersSecondChild',
-        lastName: 'rootscope broadcasting to UsersSecondChild from UserChild',
-        city: 'UserChild'
-      };
-      var event = {
-        name: USERS.ROOTSCOPE.BROADCAST_TO_SENCONDCHILD
-      };
-
-      UsersSecondChildController.usersSecondChildOnRootScopeBroadcast(event, rootScopeBroadcastUser);
-
-      expect(UsersSecondChildController.rootScopeBroadcastUser).toEqual(rootScopeBroadcastUser);
-    });
-
-    it('should be assigned broadcastUser', function () {
-      var scopeBroadcastUser = {
-        name: 'UsersChild To UsersSecondChild',
-        lastName: 'rootscope broadcasting to UsersSecondChild from UserChild',
-        city: 'UserChild'
-      };
-      var event = {
-        name: USERS.SCOPE.BROADCAST_TO_SENCONDCHILD
-      };
-
-      UsersSecondChildController.usersSecondChildOnScopeBroadcast(event, scopeBroadcastUser);
-
-      expect(UsersSecondChildController.scopeBroadcastUser).toEqual(scopeBroadcastUser);
-    });
-  });
-
-});
diff --git a/angularjs/stomp/src/stomp/app/users/users.constants.js b/angularjs/stomp/src/stomp/app/users/users.constants.js
deleted file mode 100644 (file)
index 4947956..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-(function () {
-  'use strict';
-
-  angular
-    .module('app.users')
-    .constant('USERS', {
-      ROOTSCOPE: {
-        BROADCAST: 'USERS_ROOTSCOPE_BROADCAST',
-        BROADCAST_TO_SENCONDCHILD: 'USERS_ROOTSCOPE_BROADCAST_TO_SENCONDCHILD'
-      },
-      SCOPE: {
-        EMIT_FACT: 'USERS_SCOPE_EMIT_FACT',
-        BROADCAST_TO_SENCONDCHILD: 'USERS_SCOPE_BROADCAST_TO_SENCONDCHILD'
-      }
-    });
-
-})();
diff --git a/angularjs/stomp/src/stomp/app/users/users.controller.js b/angularjs/stomp/src/stomp/app/users/users.controller.js
deleted file mode 100644 (file)
index 7a8723b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-(function () {
-  'use strict';
-
-  angular
-    .module('app.users')
-    .controller('UsersController', UsersController);
-
-  /**
-   * @ngdoc controller
-   * @name app.users.controller:UsersController
-   *
-   * @requires $rootScope
-   * @requires $scope
-   *
-   * <p>
-   * <br>
-   * {@link https://docs.angularjs.org/api/ng/service/$rootScope $rootScope}
-   * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope}
-   * </p>
-   *
-   * @description
-   * UsersController controller.
-   */
-  /* @ngInject */
-  function UsersController($rootScope, $scope, USERS) {
-    var vm = this;
-    var rootScopeBroadcastUser = {
-      name: 'Snake',
-      lastName: 'Eyes',
-      city: 'classified'
-    };
-    var scopeBroadcastUser = {
-      name: 'Shana',
-      lastName: 'M. O\'Hara',
-      city: 'Atlanta'
-    };
-    var valueForChildControllers = {
-      variable: 'This is a variable from UsersController',
-      value: 'Hello child controller'
-    };
-
-    vm.getRootScopeBroadcast = function () {
-      $rootScope.$broadcast(USERS.ROOTSCOPE.BROADCAST, rootScopeBroadcastUser);
-    };
-    vm.getScopeBroadcast = function () {
-      $scope.$broadcast(USERS.ROOTSCOPE.BROADCAST, scopeBroadcastUser);
-    };
-    vm.usersOnEmitFact = function (events, emitFact) {
-      vm.emitFact = emitFact;
-      console.log('usersOnEmitFact, events.name: ' + events.name);
-    };
-    vm.toBeCalledFromChildControllers = function () {
-      return valueForChildControllers;
-    };
-
-    $scope.$on(USERS.SCOPE.EMIT_FACT, vm.usersOnEmitFact);
-  }
-
-})();
diff --git a/angularjs/stomp/src/stomp/app/users/users.controller.spec.js b/angularjs/stomp/src/stomp/app/users/users.controller.spec.js
deleted file mode 100644 (file)
index 6919a11..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-describe('app.users', function() {
-  'use strict';
-
-  var $rootScope;
-  var $scope;
-  var USERS;
-  var UsersController;
-
-  beforeEach(function() {
-    module('app.users');
-
-    inject(function($controller, _$rootScope_, _USERS_) {
-      $rootScope = _$rootScope_;
-      USERS = _USERS_;
-      $scope = $rootScope.$new();
-
-      spyOn($rootScope, '$broadcast');
-      jasmine.createSpy($scope, '$scope.$broadcast');
-      UsersController = $controller('UsersController', {
-        $rootScope: $rootScope,
-        $scope: $scope,
-        USERS: _USERS_
-      });
-    });
-  });
-
-  describe('UsersController', function () {
-
-    it('should be created successfully', function () {
-      expect(UsersController).toBeDefined();
-    });
-
-    it('should be called $rootScope.$broadcast', function () {
-      var rootScopeBroadcastUser = {
-        name: 'Snake',
-        lastName: 'Eyes',
-        city: 'classified'
-      };
-
-      UsersController.getRootScopeBroadcast();
-
-      expect($rootScope.$broadcast).toHaveBeenCalledWith(USERS.ROOTSCOPE.BROADCAST, rootScopeBroadcastUser);
-    });
-
-    it('should be called $scope.$broadcast', function () {
-      var scopeBroadcastUser = {
-        name: 'Shana',
-        lastName: 'M. O\'Hara',
-        city: 'Atlanta'
-      };
-
-      UsersController.getScopeBroadcast();
-
-      expect($scope.$broadcast).toHaveBeenCalledWith(USERS.ROOTSCOPE.BROADCAST, scopeBroadcastUser);
-    });
-
-    it('should be assigned emitFact', function () {
-      var emitFact = {
-        title: 'Snake and Scarlett',
-        fact: 'it is canon'
-      };
-      var event = {
-        name: 'USERS_SCOPE_EMIT_FACT'
-      };
-
-      UsersController.usersOnEmitFact(event, emitFact);
-
-      expect(UsersController.emitFact).toEqual(emitFact);
-    });
-  });
-
-});
diff --git a/angularjs/stomp/src/stomp/app/users/users.html b/angularjs/stomp/src/stomp/app/users/users.html
deleted file mode 100644 (file)
index fba9854..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<div class="container" ng-controller="UsersController as usersController">
-  <div>title = {{usersController.emitFact.title}}</div>
-  <div>fact = {{usersController.emitFact.fact}}</div>
-  <button type="button" class="btn btn-primary" ng-click="usersController.getRootScopeBroadcast()">
-    $rootScope.$broadcast
-  </button>
-
-  <button type="button" class="btn btn-primary" ng-click="usersController.getScopeBroadcast()">
-    $scope.$broadcast
-  </button>
-
-  <div class="container" ng-controller="UsersChildController as usersChildController">
-    <div>name = {{usersChildController.broadcastUser.name}}</div>
-    <div>lastname = {{usersChildController.broadcastUser.lastName}}</div>
-    <div>city = {{usersChildController.broadcastUser.city}}</div>
-
-    <button type="button" class="btn btn-primary" ng-click="usersChildController.getEmit()">
-      $scope.$emit fact
-    </button>
-    <br>
-    <button type="button" class="btn btn-primary" ng-click="usersChildController.broadcastToSencondChild()">
-      $scope.$broadcast and $rootScope.$broadcast to second child
-    </button>
-    <br><br>
-    <label>controller as, retrieving value from parent controller:</label>
-    <br>
-    <div>valueForChildControllers.variable = {{usersChildController.valueForChildControllers.variable}}</div>
-    <div>valueForChildControllers.value = {{usersChildController.valueForChildControllers.value}}</div>
-  </div>
-  <div class="container" ng-controller="UsersSecondChildController as usersSecondChildController">
-    <br>
-    <label>secondchild $scope.$on listening for $rootScope.$broadcast from UsersChildController:</label>
-    <br>
-    <div>name = {{usersSecondChildController.rootScopeBroadcastUser.name}}</div>
-    <div>lastname = {{usersSecondChildController.rootScopeBroadcastUser.lastName}}</div>
-    <div>city = {{usersSecondChildController.rootScopeBroadcastUser.city}}</div>
-
-    <br>
-    <label>secondchild $scope.$on listening for $scope.$broadcast from UsersChildController, same level never works:</label>
-    <br>
-    <div>name = {{usersSecondChildController.scopeBroadcastUser.name}}</div>
-    <div>lastname = {{usersSecondChildController.scopeBroadcastUser.lastName}}</div>
-    <div>city = {{usersSecondChildController.scopeBroadcastUser.city}}</div>
-
-  </div>
-
-</div>
diff --git a/angularjs/stomp/src/stomp/app/users/users.module.js b/angularjs/stomp/src/stomp/app/users/users.module.js
deleted file mode 100644 (file)
index 0ea1180..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-(function() {
-  'use strict';
-
-  /**
-   * @ngdoc overview
-   * @name app.users
-   *
-   * @requires app.core
-   *
-   * @description
-   * # app.users
-   *
-   * ## Module users.
-   * Module in charge of dealing with users.
-   */
-  angular.module('app.users', [
-    'app.core'
-  ]);
-
-})();
diff --git a/angularjs/stomp/src/stomp/app/users/users.route.js b/angularjs/stomp/src/stomp/app/users/users.route.js
deleted file mode 100644 (file)
index 62ca965..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-(function() {
-  'use strict';
-
-  angular
-    .module('app.users')
-    .config(route);
-
-  /**
-   * @ngdoc service
-   * @name app.users.route
-   *
-   * @requires $stateProvider
-   * @requires $urlRouterProvider
-   *
-   * <p>
-   * <br>
-   * {@link http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$stateProvider $stateProvider} <br>
-   * {@link http://angular-ui.github.io/ui-router/site/#/api/ui.router.router.$urlRouterProvider $urlRouterProvider}
-   * </p>
-   *
-   *
-   * @description
-   * Router configuration for users application.
-   */
-  /* @ngInject */
-  function route($stateProvider, $urlRouterProvider) {
-    var state = 'users';
-    var config = {
-      abstract: false,
-      url: '/users',
-      templateUrl: 'app/users/users.html'
-    };
-
-    $urlRouterProvider.otherwise(state);
-    $stateProvider.state(state, config);
-  }
-}());
diff --git a/angularjs/stomp/src/stomp/app/users/users.route.spec.js b/angularjs/stomp/src/stomp/app/users/users.route.spec.js
deleted file mode 100644 (file)
index 0131620..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-describe('app.users', function() {
-  'use strict';
-
-  describe('state', function() {
-    var view = {
-      users: 'app/users/users.html'
-    };
-    var $state;
-
-    beforeEach(function() {
-      module('app.users');
-
-      inject(function(_$state_) {
-        $state = _$state_;
-      });
-    });
-
-    it('should map /users route to users View template', function() {
-      expect($state.get('users').templateUrl).toEqual(view.users);
-    });
-
-  });
-
-});
index 68ba700..2b71a4e 100644 (file)
     <!-- Custom JavaScript -->
     <!-- build:js(.) js/app.min.js -->
     <!-- inject:js -->
-    <script src="/src/stomp/app/users/users.module.js"></script>
-    <script src="/src/stomp/app/users/users.route.js"></script>
-    <script src="/src/stomp/app/users/users.controller.js"></script>
-    <script src="/src/stomp/app/users/users.constants.js"></script>
-    <script src="/src/stomp/app/users/users-second-child.controller.js"></script>
-    <script src="/src/stomp/app/users/users-child.controller.js"></script>
+    <script src="/src/stomp/app/example/example.module.js"></script>
+    <script src="/src/stomp/app/example/example.route.js"></script>
+    <script src="/src/stomp/app/example/example.controller.js"></script>
     <script src="/src/stomp/app/core/core.module.js"></script>
     <script src="/src/stomp/app/app.module.js"></script>
     <!-- endinject -->