This tutorial is targeted to people familiar with JavaScript and HTML/CSS. You also will need:
- Node.js up and running.
- NPM (Node package manager) .
You can verify by typing:
1 2 3 4 | node –version ## v12.13.0 npm –version ## 6.12.0 |
Angular CLI is the best way to get us started. We can download the tool and create a new project by running:
1 2 3 4 5 6 7 | ## install angular-cli globally npm install -g @angular/cli # get latest ## Check angular CLI is installed ng –version ## Angular CLI: 9.1.7 Angular CLI: 6.0.8 Node: 12.16.1 OS: win32 x64 Angular: … … |
Scafold the app using the following command.
1 2 | ## create a new project ng new Playground –style=scss |
Note The last command takes some minutes. Leave it running and continue reading this tutorial.
The command ng new
will do a bunch of things for us:
- Initialize a git repository
- Creates an
package.json
files with all the Angular dependencies. - Setup TypeScript, Webpack, Tests (Jasmine, Protractor, Karma). Don’t worry if you don’t know what they are. We are going to cover them later.
- It creates the
src
folder with the bootstrapping code to load our app into the browser - Finally, it does an
npm install
to get all the packages intonode_modules
.
Let’s run the app!
1 2 3 | cd Playground ## builds the app and run it on port 9000 npm install rxjs@6.0.0 –save ng serve —port 9000 |
1.In Git hub create Repository Playground.
Then in the command line prompt execute the following
- git init
- git add *
- git commit -m “Initial Commit.”
4.git remote add origin https://github.com/username/Playground.git (GIT_CLONE_URL) 5.git branch -M master 6. git push -u origin master