Skip to content

Instantly share code, notes, and snippets.

@blove
Created July 15, 2018 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blove/11ee297ec2e0d8940b0bb04e53ee76ca to your computer and use it in GitHub Desktop.
Save blove/11ee297ec2e0d8940b0bb04e53ee76ca to your computer and use it in GitHub Desktop.
Angular CLI Workspace Cheat Seet

Angular CLI Workspace Cheat Sheet

You must first generate a new project before using workspaces:

ng new my-app

generate

Generate a new project:

ng g application my-project

Generate a new lib:

ng g lib my-lib

generate component

Generate a new component within a project:

ng g c my-component --project my-project

It's the same to generate a new component within a lib:

ng g c my-component --project my-lib

generate service

Generate a new service within a project:

ng g s my-service --project my-project

It's the same to generate a new service within a lib:

ng g s my-service --project my-lib

serve

Serve the root application:

ng s

Serve a project:

ng s my-project

build

Build the root application:

ng b

Buid a project:

ng b my-project

Buid a lib:

ng b my-lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment