Angular JS route causing infinite loop

后端 未结 9 1484
清歌不尽
清歌不尽 2020-12-31 11:00

I\'m trying to figure out why the page doesn\'t navigate to its template when clicked. The URL updates, and I have no JS errors.. I believe it loads the file, but t

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 11:20

    Problem with Same Symptoms

    I recently solved a similar problem in one of my projects. I added console.log("Video Page Controller Loaded") into the controller I was debugging. Likewise, it logged that text until I close the tab.

    My solution:

    I was referenced the wrong name for the template file.

    when('/videos', {
      templateUrl: 'templates/video-list.tpl.html',
      controller: 'VideoListCtrl'
    })
    

    When I should have had:

    when('/videos', {
      templateUrl: 'templates/video-list.html',
      controller: 'VideoListCtrl'
    })
    

提交回复
热议问题