AngularJs: controller is called twice by using $routeProvider

前端 未结 10 2246
慢半拍i
慢半拍i 2020-12-04 14:43

Module routes:

var switchModule = angular.module(\'switchModule\', []);

switchModule.config([\'$routeProvider\', function($routeProvider) {
    $routeProvid         


        
10条回答
  •  星月不相逢
    2020-12-04 14:59

    I had the same problem , and it seems there is a stupid bug with routing. There is some kind of redirection going on.

    to fix it , i just added a slash in the href , like :

  • I hope it will fix things for you too.

提交回复
热议问题