Wednesday 7 September 2016

Angular JS - Update View text from contoller using $rootScope

Angular JS -  Update View text from contoller using $rootScope 
=======================================

if(!rootScope.sitename)
    {
        rootScope.sitename = "App";
        rootScope.searchcol =  "App";
    }

$scope.SearchDashboard = function(sitename, searchcol){
        rootScope.sitename = sitename; 
        rootScope.searchcol =  searchcol;
        $location.path('dashboard/'+'-'+sitename)  //reload the page to update
    }



view:
=======
  <a href="" ng-click="SearchDashboard(sitename,'Site')" title=" {{sitename}}" class="ng-binding">   {{sitename}}</a>

No comments:

Post a Comment