javascript - Controller methods do not call when opening link on a new tab -
in angular app have link when clicked navigated page .
<ul class="nav navbar-nav"> <li ng-class="{'current':iscurrent('/home')}"> <a href="#home" >home</a> </li> </ul>
it works fine , when open link on new tab right click . page loaded controller methods not getting loaded. not having idea why happening.
$routeprovider.when('/home', { templateurl: 'views/home.html', controller: 'dashboardcontroller dashboard' });
controller
(function() { function dashboardcontroller($filter) { this.retrievedata = function() { // data retrieved server here }; this.initpage = function() { ctrl.retrievedata(); }; ctrl.initpage(); } angular.module('esg.controllers').controller('dashboardcontroller', ['$filter', dashboardcontroller]);
})();
Comments
Post a Comment