Skip to content

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

License

Notifications You must be signed in to change notification settings

antoinezaz/ngrx-store-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 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 : npm install ngrx-store-router

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 'angular2/platform/bootstrap';
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%