├── .gitignore ├── README.md ├── client ├── app │ ├── app.ts │ ├── boot.ts │ └── items.ts ├── assets │ ├── css │ │ └── app.css │ └── img │ │ └── eggly-logo.png ├── config.js └── index.html ├── package.json ├── server └── api │ └── db.json └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | client/**/*.js 4 | client/**/*.map 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Reactive RESTful Angular 2 application with ngrx store 2 | 3 | A RESTful master-detail application built using Angular 2 and [ngrx store](https://github.com/ngrx/store). 4 | 5 | ### Getting Started 6 | 7 | There are two main parts to this application. The first is the server which we are using `json-server` to simulate a REST api. The second part is the Angular 2 application which we will use `lite-server` to display. 8 | 9 | To get started run the commands below. 10 | 11 | ``` 12 | $ git clone https://github.com/simpulton/ngrx-rest-app.git 13 | $ cd nxrx-rest-app 14 | $ npm install 15 | $ npm start 16 | ``` 17 | -------------------------------------------------------------------------------- /client/app/app.ts: -------------------------------------------------------------------------------- 1 | //our root app component 2 | import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy} from 'angular2/core' 3 | import {ItemsService, Item, AppStore} from './items' 4 | import {Observable} from 'rxjs/Observable'; 5 | import {Store} from '@ngrx/store' 6 | 7 | //------------------------------------------------------------------- 8 | // ITEMS-LIST 9 | //------------------------------------------------------------------- 10 | @Component({ 11 | selector: 'items-list', 12 | template: ` 13 |