Home
Do you know the right way to create your Angular project?
  v6.0 Posted at 11/05/2017 6:55 AM by Tiago Araujo
Angular.io​ is a great place to get started learning Angular 2, but do not use the tutorials as the template for your real apps!​​

The Quick Start  and Tour of Heros Tutorial will teach you lots about Angular 2 but are not examples of real world projects because:

  1. They do not include a method to create a production build output
    See Do you know the best build tool?
  2. They do not consider whether your application will require the redux pattern 
    See Do you know to use ngrx on complex applications?
  3. They do not include a UI framework
    See Do you know the best UI framework for Angular 2?


There are also several well used templates that incorporate Angular and server-side tooling.

The leading example is the ASP.NET template for Angular https://github.com/aspnet/JavaScriptServices/tree/dev/templates
While these starters often include advanced functionality, we prefer to implement pure Angular CLI projects where possible because Angular updates frequently.. and when you are using someone else's template that incorporates Angular you are left with the options of waiting for them to update their template to the latest version of Angular, or working out how to​ do it yourself. This can often leave you with large amounts of work or be being several months behind the latest versions.

To learn how to build real-world Angular 2 applications check out FireBootCamp.

create-angular-bad.png
Figure: Bad Example - Using regular Angular tutorials
create-angular-good.png
Figure: Good Example: The Angular CLI will create you a new Angular 2 project with a single command, and that project will be all setup with production build, unit testing and end to end testing all configured. If you have very specific build requirements the CLI does not currently support custom webpack builds, though this is coming. See https://rules.ssw.com.au/the-best-build-tool for more info

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.