Why does AngularJS ng-view not work locally?

后端 未结 3 425
粉色の甜心
粉色の甜心 2020-12-05 02:55

I have been working for a few hours on getting my links to click through to different views with my AngularJS app.

However, I can only seem to get the functionality

3条回答
  •  [愿得一人]
    2020-12-05 03:47

    ng-view and ng-include make ajax requests to serve the template file. Because you're running it locally, it can't make that request. An easy fix around this is to use http-server to serve your contents over a local server.

提交回复
热议问题