Is it possible to use ng-include without web server?

后端 未结 5 1452
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 04:10

I\'m running an AngularJS app which merely include a file

That works when run un

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 04:18

    I had a similar problem and I solved it by running a simple nodejs server to serve static files - http-server. Make sure you have nodejs installed, then:

    Install:

    $ sudo npm install http-server -g

    Then from your project directory:

    $ http-server

    Now you can access your files from:

    localhost:8080/whatever-file-you-have-in-your-directory.html

提交回复
热议问题