AngularJs: controller is called twice by using $routeProvider

前端 未结 10 2252
慢半拍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:06

    A controller can be added to more than one element of the DOM, so this problem can occur if this has been done e.g. :

      
    ....

提交回复
热议问题