Create new project in angular

Create a new application (SPA: Single Page Application) in Angular 2 or Angular 6 or latest version, it’s upgraded version of AangularJs. If you know basic CSS and HTML then you can start work with angular. Must required typescript for this, if you have a vast knowledge of javascript then you will learn fastly because this is ECMAScript. If you know Javascript basic then can you start because here required Typescript and typescript code be in ECMAScript. We write our code through CLI command it’s running in CMD. Creating new project Angular CLI required. Now you can start work as given below guideline:
First of all please install node.js from the node site download LTS version as your system.


After then install angular/cli in the node platform, from the https://cli.angular.io/

npm install -g @angular/cli

“-g” stand for globally install angular packages.  After installation check version “ng -v” command on the cmd.

Generating and serving an Angular project via a development server

ng new PROJECT-NAME
cd PROJECT-NAME
ng serve

You will found an URL as like http://localhost/4200

You can open it on the browser, you can manage it with some command as like in below:

ng serve -o
           
(it will run directly on the browser when all files compile successfully. :)

Some important command as we need maximum time, as-


ng generate component componentName OR ng g c componentName

No comments:

Note: Only a member of this blog may post a comment.

Copyright Reserved to Anything Learn. Powered by Blogger.