Angular JS route causing infinite loop

后端 未结 9 1489
清歌不尽
清歌不尽 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:21

    I have had this same issue before as well and I think the root cause is the use of which it looks like was used in this case as well. The route will already load a template URL so I believe the use of the ng-view directive causes that template to get loaded recursively causing an infinite loop.

    Try removing ng-view and instead either place all view markup directly in the .html template you specify in templateUrl of the route. Alternatively, if it is a shared template try using ng-include instead(e.g.

    Don't forget the single quotes around your path to identify it as a string as opposed to a scope variable reference!).

提交回复
热议问题