Exploring Angular CLI Commands

 "ng serve" : ng serve command will keep polling for any changes in code and as soon as you made any change it will build it. For Example:
go to your src folder and open index.html and change the title from todoList to anything else like "Todo List Application" and save it, after refreshing you localhost URL you can see your change reflecting as shown below



"ng lint" : this command is deprecated but you can add it in your project see below screen shot, this command will check for coding standard and you can update it as per your project requirement. File name: esLintrc.json



"ng build" : when you run "ng build" it will create some files and when you go to visual studio IDE you can see a new folder "dist" is created and you see files like index.html and all.
This dist folder you can use behind any webserver and you can directly launch index.html and run the entire application.




"ng test" : ng test runs the unit test case for angular application. Jasmine is the framework in which unit test for Angular is written. and we are using Karma to run the unit test. 


You can check Karma.conf.js file which the the configuration file for Karma and app.component.spec.ts file which is you test class. Some test case is there by default.
Test Class file is having extension as .spec.ts




Previous Topic(Import Project in IDE)                                                 Next Topic (Project Structure)

Comments

Popular posts from this blog

Installing Node Js (NPM) & Visual Studio Code

Logout Component and Angular Router (CanActivate)

Authentication and Session Storage