How/when to use ng-click to call a route?

前端 未结 8 991
时光说笑
时光说笑 2020-11-30 16:32

Suppose you are using routes:

// bootstrap
myApp.config([\'$routeProvider\', \'$locationProvider\', function ($routeProvider, $locationProvider) {

    $rout         


        
8条回答
  •  眼角桃花
    2020-11-30 17:18

    just do it as follows in your html write:

    
    

    And in your controller, add $state as follows:

    .controller('homeCTRL', function($scope, **$state**) {
    
    $scope.going = function(){
    
    $state.go('your route');
    
    }
    
    })
    

提交回复
热议问题