AngularJs: controller is called twice by using $routeProvider

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

Module routes:

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

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


        
10条回答
  •  情深已故
    2020-12-04 15:11

    Mine was a case of having 2 ng-view directives. I tried to wrap it, but unintentionally duplicated it:

    Removed the wrapper, fixed it.

提交回复
热议问题