Tips and Tricks in a world of Mix

Posts tagged ‘Serve’

Install Angular 4 – quickstart

angular4So, all of us heard about Angular 4, but where do we start.
IN THIS POST IT’S A SHORT LIST OF ACTIONS TO START WORKING WITH ANGULAR 4.

npm install -g @angular/cli

 

ng new projectname
cd projectname
ng -v
Copy paste BY YOUR OPERATING SYSTEM to cmd and run.

We have two main ways to update. If you have an existing project, you should be able to run:

On Linux/Mac: npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save On Windows: npm install @angular/common@next @angular/compiler@next @angular/compiler-cli@next @angular/core@next @angular/forms@next @angular/http@next @angular/platform-browser@next @angular/platform-browser-dynamic@next @angular/platform-server@next @angular/router@next @angular/animations@next --save

Then run whatever ng serve or npm startcommand you normally use, and everything should work.

Please ensure that you are using Typescript v2.1.6 or higher.

If you rely on Animations you’ll also need to install the animations package @angular/animationsand import the new BrowserAnimationsModulefrom @angular/platform-browser/animationsin your root NgModule. Without this, your code will compile and run, but animations won’t activate. Imports from @angular/core were deprecated, use imports from the new package import { trigger, state, style, transition, animate } from '@angular/animations';.
Update typescript
In cmd
npm install typescript@2.2.1 – – save
ng -v
ng serve
________________________
To work with quickstart
 npm install
ng -v  (uses angular 2)
Again paste the lines from the changelog
Then
npm start

Tag Cloud

%d bloggers like this: