Is there a simple way to use button to navigate page as a link does in angularjs

后端 未结 7 1432
慢半拍i
慢半拍i 2020-12-23 21:31

In angularjs, I want to use button like this, but I still need the button looking.

7条回答
  •  青春惊慌失措
    2020-12-23 21:57

    You can also register $location on the scope in the controller (to make it accessible from html)

    angular.module(...).controller("...", function($location) {
      $scope.$location = $location;
      ...
    });
    

    and then go straight for the honey in your html:

提交回复
热议问题