Skip to content

NathanWalker/ngrx-store-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngrx-store-router

Sync between the current Angular 2 Router URL and @ngrx/store

This middleware is to be used along with @ngrx/store and @ngrx/devtools to navigate between routes while changing state

Demo

http://plnkr.co/edit/Gvg9fW?p=preview

Installation

  • Install from npm : DEPRECATED Router npm install ngrx-store-router@0.2.0 --save
  • Install from npm : npm install ngrx-store-router --save

Usage

  • In your app's main module, import the router reducer, add the reducer to the provideStore() function under the name router, and add the routerMiddleware to provide them to Angular 2.
import {bootstrap} from '@angular/platform-browser-dynamic';
import {provideStore} from '@ngrx/store';
import {App} from './app';

import {routerReducer, routerMiddleware} from 'ngrx-store-router';

bootstrap(App, [
  provideStore({router: routerReducer}),
  routerMiddleware
]);

Contributing

Pull requests and issues are welcome

About

Sync between the current Angular 2 Router URL and @ngrx/store

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%