命令行创建:
ng new jerryfirstapp

创建完毕:

ng serve --open,然后 localhost:4200 能看到如下页面:

创建一个新的 gh-pages 分支:
git checkout -b gh-pages
使用如下命令行进行构建:
ng build --output-path docs --base-href /first-angular/
当构建完成时,把 docs/index.html 复制为 docs/404.html。



之后,我就可以用下面这个链接,访问我发布在 gh-pages 上的应用了:
https://wangzixi-diablo.github.io/first-angular/

更多Jerry的原创文章,尽在:"汪子熙":

网友评论