javascript - AngularJS Controller Access for all views -


i'm working on angularjs app , attempting create controller functions used throughout app. examples of include button, logout button, , navigation links. when trying execute it, won't work. how able make work.

for reference, body starts

below controller code:

angular.module('squeeg.controllers', []) .controller('squeegapp', function($scope, $state, $rootscope, $stateparams) {    $scope.back = function() {      $state.go('welcome');    };     $scope.logout = function() {     parse.user.logout();     $rootscope.user = null;     $rootscope.isloggedin = false;     $state.go('welcome', {         clear: true     });  };  })  .controller('welcomecontroller', function($scope, $state, $rootscope, $stateparams) {   alert("test");  })  .controller('homecontroller', function($scope, $state, $rootscope) {  $scope.home = "home";   })   .controller('view2', function($scope, $state, $rootscope) {   $scope.message = "test";   }); 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -