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
Post a Comment