Browse the slides here: https://slides.com/zdichev/deck
-
Install node.js. for your platform https://nodejs.org/en/download/ Node installs also node package manager aka NPM. You guessed it! That NPM is the program that manages our apps dependencies. So we only need the manifest file
package.json
. -
Install Angular CLI A command line interface for Angular: https://cli.angular.io/
npm install -g angular-cli
-
Clone this repo Duuuh
-
Get into the folder and run
npm install
. That will instal the whole project with its dependencies -
First let's add some styling magic. Install bootstrap. https://v4-alpha.getbootstrap.com/
npm install bootstrap@4.0.0-alpha.6 -S
We are getting the newest bootstrap with all its goodies.
-
Let's add some font icons - FontAwesome is great for the job. http://fontawesome.io/
npm install font-awesome -S
npm install [package] -S
is short fornpm install [package] --save
For more info check: https://docs.npmjs.com/cli/install
Actually I wired the application in that way that it relies on the packages we just installed. Because of time limitation i had to do some plumbing work on my own. Don't worry if you have some questions I will be around to satisfy your curiosity.
-
Lets add two new pages to our client
We'll use ng-cli to add two new components - people and about. These components are going to become new pages.
ng g component pages/people
ng g component pages/about
Ng-cli will update the import statements and the
@NgModule
decorator function to ensure that the components become part of our application. Check it after the commands finish.Handy isn't it!
-
Let's add some menu item to point to our freshly added pages. We can do that by extending the
RouterModule
inapp.module.ts
with two new objects: When you finishRouterModule.forRoot()
function call should look like this:RouterModule.forRoot( [ { path: '', component: HomeComponent }, { path: 'people', component: PeopleComponent }, { path: 'about', component: AboutComponent } ] )
-
We have completely wired, styled and back-end communication enabled application. Volia !
-
Do something on your own. Don't forget to have FUN !
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive/pipe/service/class/module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via ng serve
.
Run ng github-pages:deploy
to deploy to Github Pages.
To get more help on the angular-cli
use ng help
or go check out the Angular-CLI README.