This project was generated with Angular CLI version 1.0.0-rc.1. It introduces some of the most basic concepts of angular. Therefore it will display a list of GitHub-Commits in a Master-Detail view.
A running version can be found at https://alex-kuck.github.io/angular-basic-concepts, hosted on GitHub Pages.
Install Angular CLI. To do so, perform npm install -g @angular/cli@latest
on the command line.
Generate a new angular app with routing capabilities using the CLI. The command to do this is ng new --routing AngularBasicConcepts
.
Generate one component for the home screen of the app, one component for the master-view and one for the detail-view. Embed the detail-view in the master-view and
add routes to home and master, with default routing to the home screen. Add links to home-screen and master-view in app.component.html
.
Create model classes and a service to fetch the commit-data from GitHub. You can use e.g. https://api.github.com/repos/awesome-inc/docker-elk-cyber/commits
or the URL
of this repo. See the GitHub Api for additional information.
Import rxjs/Observable
and rxjs/add/operator/map
in your service for comfort.
In the master-view display a list of events. If the user clicks on one element of the list, the detail-view should display the detailed information for this event.
Use an @Input()
property to enable the communication between parent and child component.
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
.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.