text: (function(){
  
    angular
         .module('users')
         .controller('UserController', [
            'userService', '$mdSidenav', '$mdBottomSheet', '$log', '$q',
            UserController
         ]);
    angular
          .module('triund')
          .controller('trndCtrl',function($scope){
            $scope.message= "This page will be used to display Triund page"
          });
     angular
          .module('triund')
          .controller('mapCtrl', function($scope){
  
            $scope. message = "This page will be used to dispay the map of Triund"
          });
  
  
    /**
     * Main Controller for the Angular Material Starter App
     * @param $scope
     * @param $mdSidenav
     * @param avatarsService
     * @constructor
     */
  
  
    function UserController( userService, $mdSidenav, $mdBottomSheet, $log, $q) {
      var self = this;
  
      self.selected     = null;
      self.users        = [ ];
      self.selectUser   = selectUser;
      self.toggleList   = toggleUsersList;
      self.showContactOptions  = showContactOptions;
  
      // Load all registered users
  
      userService
            .loadAllUsers()
            .then( function( users ) {
              self.users    = [].concat(users);
              self.selected = users[0];
            });
  
      // *********************************
      // Internal methods
      // *********************************
  
      /**
       * First hide the bottomsheet IF visible, then
       * hide or Show the 'left' sideNav area
       */
      function toggleUsersList() {
        var pending = $mdBottomSheet.hide() || $q.when(true);
  
        pending.then(function(){
          $mdSidenav('left').toggle();
        });
      }
  
      /**
       * Select the current avatars
       * @param menuId
       */
      function selectUser ( user ) {
        self.selected = angular.isNumber(user) ? $scope.users[user] : user;
        self.toggleList();
      }
  
      /**
       * Show the bottom sheet
       */
      function showContactOptions($event) {
          var user = self.selected;
  
          return $mdBottomSheet.show({
            parent: angular.element(document.getElementById('content')),
            templateUrl: './src/users/view/contactSheet.html',
            controller: [ '$mdBottomSheet', ContactPanelController],
            controllerAs: "cp",
            bindToController : true,
            targetEvent: $event
          }).then(function(clickedItem) {
            clickedItem && $log.debug( clickedItem.name + ' clicked!');
          });
  
          /**
           * Bottom Sheet controller for the Avatar Actions
           */
          function ContactPanelController( $mdBottomSheet ) {
            this.user = user;
            this.actions = [
              { name: 'Phone'       , icon: 'phone'       , icon_url: 'assets/svg/phone.svg', val : 'phone'},
              { name: 'Twitter'     , icon: 'twitter'     , icon_url: 'assets/svg/twitter.svg', val: 'twitter'},
              { name: 'Google+'     , icon: 'google_plus' , icon_url: 'assets/svg/google_plus.svg'},
              { name: 'Hangout'     , icon: 'hangouts'    , icon_url: 'assets/svg/hangouts.svg'}
            ];
            this.submitContact = function(action) {
              $mdBottomSheet.hide(action);
            };
          }
      }
  
    }
  
  })();
  