I am trying to use the ng-click feature of AngularJS to switch views. How would I go about doing this with the code below?
index.html
There are two ways for this:
If you are using ui-router or $stateProvider
, do it as:
$state.go('stateName'); //remember to add $state service in the controller
if you are using angular-router or $routeProvider
, do it as:
$location.path('routeName'); //similarily include $location service in your controller