Angular CLI workflow

Often when working on using new feature Angular it is best to start out with a small prototype that isolates the feature from the rest of your site.

The advantages to this are:

  1. Able to quickly test the feature independent of your other app code
  2. By isolating the feature we will know that if/when things do not work that it is the feature code and not your existing app code that is the problem.

Workflow:

1.) create a new Angular project with routing

ng new MyProject

2.) Install dependencies

npm install

3.) run project

ng serve

4.) add component(s)

ng generate component my-component

5.) Add component to routes

const routes: Routes =
[
{ path: 'mycomponent', component: MyComponent }
];

Leave a comment

Design a site like this with WordPress.com
Get started