This final Angular article covers how to build an app ready for production, and provides further resources for you to continue your learning journey.
| Prerequisites: | Familiarity with the core HTML , CSS ,和 JavaScript languages, knowledge of the terminal/command line . |
|---|---|
| Objective: | To learn how to build your Angular app. |
Now that you are finished developing your application, you can run the Angular CLI
build
命令。
When you run the
build
command in your
todo
directory, your application compiles into an output directory named
dist/
.
在
todo
directory, run the following command at the command line:
ng build --prod
The CLI compiles the application and puts the output in a new
dist
目录。
--prod
flag with
ng build
gets rid of stuff you don't need for production.
To deploy your application, you can copy the contents of the
dist/my-project-name
folder to your web server.
Because these files are static, you can host them on any web server capable of serving files, such as:
You can use any backend such as Firebase , Google Cloud ,或 App Engine .
At this point, you've built a basic application, but your Angular journey is just beginning. You can learn more by exploring the Angular documentation, such as:
That's it for now. We hope you had fun with Angular!
最后修改: , 由 MDN 贡献者