By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| import { Injectable } from 'angular2/core'; | |
| import { Storage } from './storage'; | |
| import { CurrentUser } from '../interfaces/common'; | |
| @Injectable() | |
| export class Authentication{ | |
| private _storageService : Storage; | |
| private _userKey : string = "CURRENT_USER"; | |
| constructor(storageService : Storage){ |
| import {Component, Input, Output, EventEmitter} from "angular2/core"; | |
| import {Todo} from "../services/Todo-Service"; | |
| @Component({ | |
| selector: 'todo-item', | |
| styles: [ | |
| ` | |
| .complete{ | |
| text-decoration: line-through; | |
| } |
| //specify what state slices you would like to keep synced with local storage | |
| export function main() { | |
| return bootstrap(TodoApp, [ | |
| provideStore(APP_REDUCERS), | |
| localStorageMiddleware('todos', 'visibilityFilter') | |
| ]) | |
| .catch(err => console.error(err)); | |
| } |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
| import { inject, TestBed } from '@angular/core/testing'; | |
| import { of } from 'rxjs/observable/of'; | |
| import { LoggingService, LocalStorageService } from '../'; | |
| import { RouterEventService } from '../../routing'; | |
| export class MockLocalStorageService { | |
| setItem() {} | |
| getItem() { return []; } | |
| } | |
| export class MockRouterEventService { |