How to install Angular 2 And Other Dependencies

To start working with Angular 2, you need to do the below steps:

Installation steps:

1. Npm: This is known as the node package manager that is used to work with the open source repositories. Angular JS has dependencies on other components. And npm can be used to download these dependencies and attach them to your project. The best way to install npm is to install node using the node.js installer. npm is installed as part of node.

2. Go to Node js official website and choose the installer to download, depending on the operating system. For the purpose of this exercise, download the Windows 64 bit version.

3. Once you’ve installed Node.js, you can make sure you’ve got the very most recent version of npm using npm itself:

npm install npm -g

(on Linux, you can add the “sudo”). Running this update will give you the most recent stable version of npm, also supported by npm Inc.

4. In the command prompt, you can enter “npm version” command and you will get the npm version.

5. Install angular-cli using NPM. “npm install -g angular-cli“. Linux users will want to run this command with sudo.

6. Create a new Angular 2 project. ng new PROJECT_NAME. (This will take a few minutes.)

Angular 2 Project Folder Structure

angular-cli.json
karma.conf.js
package.json
protractor.conf.js
README.md
tslint.json
src
    favicon.ico
    index.html
    main.ts
    polyfills.ts
    styles.css
    test.ts
    tsconfig.json
    typings.d.ts
    app
        app.component.css
        app.component.html
        app.component.spec.ts
        app.component.ts
        index.ts
        shared
    assets
    environments
        environments.prod.ts
        environments.ts
e2e
    app.e2e-spec.ts
    app.po.ts
    tsconfig.json
node_modules
    ... dependencies

7. After  Successfully create a project, If you go into the root directory of the your project and enter the command “ng serve“, angular-cli will compile your project and start serving it. In the output, you’ll see the address your application is getting served at.

http://localhost:4200
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin
Share On Pinterest

Be the first to comment

Leave a Reply

Your email address will not be published.

*


*