如何在本地运行angularjs文档

hon*_*jde 20 angularjs

我编译了最新的angular.js并发现doc中的链接都指向绝对URL angularjs.org/....我希望能够在本地读取doc.

man*_*lds 15

您必须运行webserver("python -m SimpleHTTPServer)才能正确浏览文档.

作为替代方案,您可能希望尝试Dash许多API的脱机文档 - http://kapeli.com/dash


Mot*_*tin 12

另一个答案中提到的"Dash"花费大约20美元.

如需免费解决方案,请查看http://devdocs.io/

克隆角度源代码,以便在本地访问所有已发布(尚未发布)版本的docs目录.


Sim*_*Ink 5

本地AngularJS API文档

这是我在Mac上本地托管Angular.JS文档的方式:

  1. 下载Angular.JS内部版本的压缩版本,其中包含AngularJS的内部版本以及文档和其他内容。
  2. 解压缩Angular.JS docs文件夹。
  3. 下载并安装Node.js的
  4. 使用Mac Terminal,全局安装npm软件包http-server,以便可以从命令行运行它。

$ sudo npm install -g http-server

  1. cd到Angular.JS docs文件夹并启动http-server

$ http-server -a 127.0.0.1 Starting up http-server, serving ./ on: http://127.0.0.1:8080

  1. 使用浏览器查看文档@ http://127.0.0.1:8080/index-production.html

注意:在Chrome中 使用http-serverhttp://0.0.0.0:8080)和http://0.0.0.0:8080/index-production.html所提供的默认设置将最终在Google搜索中使用。或者,您可以创建一个书签,Chrome会停止搜索它。