Skip to content Skip to sidebar Skip to footer

Re-render Same Angular Template

When I am loading index.html page then by default UI router is loading home.html After click on name of home page data I am showing list.html page as a child template. As per sele

Solution 1:

Inject $state instead of $location and use $state.go:

$scope.clickOfButton = function() {
  $state.go('home.list', { list: 'someName' }, { reload: true });
}

Where someName is what you want showing in the URL:

/#/home/someName

To retrieve the value of the list parameter you can inject $stateParams and access it like this:

demoApp.controller('listController', function($scope, demoFactory, $stateParams) {

  console.log($stateParams.list);

Post a Comment for "Re-render Same Angular Template"