routing - Angularjs trigger route re-build page -


i have singlepage aplication , when. need rebuild page on $location.search changed. when i'm on page "/home" , link changed "home?key=value" should rebuild page out phisical refreshing "f5".

     $stateprovider         .state('fulltemplate.rootwithoutslash', {             url: '',             views: _.assign({}, views, {                 'default': {                     templateurl: 'pages/home/home.tpl.html',                     controller: 'homecontroller',                     controlleras: 'home'                 }             })         });  (function (angular) {   angular     .module('pctv.pages')     .controller('homecontroller', homecontroller);    homecontroller.$inject = ['$timeout',     '$rootscope',     '$location'   ];     function homecontroller(                         $rootscope,                         $location) {     if ($location.search()['key']){         this.title = "home page search";     } else {         this.title = "home page";     }  } }(window.angular)); 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -