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

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

Suppose you are using routes:

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

    $rout         


        
8条回答
  •  北海茫月
    2020-11-30 17:32

    Here's a great tip that nobody mentioned. In the controller that the function is within, you need to include the location provider:

    app.controller('SlideController', ['$scope', '$location',function($scope, $location){ 
    $scope.goNext = function (hash) { 
    $location.path(hash);
     }
    
    ;]);
    
      
    next page

提交回复
热议问题