Design a site like this with WordPress.com
Get started

Angular JS Basic Commands

ng new

This Command will be used to create new app in angular js.It will use predefined schmatics to create app

it will ask for couple of details like routing ,styling framework like less,CSS etc and then generate angular application and at the end it will download alldependencies in node_modules folder.

Below app will get created by this command


ng generate

This command will be used to create component,services in angularjs

you can generate or play below things as per documentation

appShell
application
class
component
directive
enum
guard
interface
library
module
pipe
service
serviceWorker
universal
webWorker

Below is example


ng serve

This command will be used to complie and run angular js applicaiton and its configuration are mentioned in angular.json file

Below is example

ng test

This command will run testcase using configuration mentioned in angular.json file.This b default run karma framework which is allready mentioned in dependencies

Below is example


ng e2e

This commend is having following configuration in angular.json file and it will uilds and serves an Angular app, then runs end-to-end tests using Protractor.

Below is example


ng build

This commend is having following configuration in angular.json file

Below is example


ng lint

Default configuration is specified in the project’s tslint.json file, This will run linting tools on angular projects typescript files and shows erros if any descrepencies are there

Referecnce: https://palantir.github.io/tslint/

Below is example


ng config

This command will Retrieves or sets Angular configuration values in the angular.json file for the workspace.

Below is example


ng run

This command will runs an Architect target with an optional custom builder configuration defined in your project

In this command you have to mention for which project you need to run architect target like below example

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: