All Projects → angular-redux → router

angular-redux / router

Licence: MIT license
Keep your Angular2+ router state in Redux

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to router

Angular2 Contacts Demo
Angular 2 (ng2) 通讯录例子
Stars: ✭ 78 (+178.57%)
Mutual labels:  angularjs, angular2
Fef
The Front End Framework is a Thomson Reuters Tax and Accounting project to create a re-usable library for creating rich HTML based applications. The end goal is to assemble the publicly available libraries into a reference application with documentation along with best practice architecture.
Stars: ✭ 96 (+242.86%)
Mutual labels:  angularjs, angular2
Paperadmin
A flat admin dashboard using Angular JS 2/4
Stars: ✭ 80 (+185.71%)
Mutual labels:  angularjs, angular2
Root Bootstrap 4 Admin Template With Angularjs Angular 2 Support
Root is Boostrap 4 Admin Template with Angular 2 and AngularJS support
Stars: ✭ 54 (+92.86%)
Mutual labels:  angularjs, angular2
Fusebox Angular Universal Starter
Angular Universal seed project featuring Server-Side Rendering, @fuse-box bundling, material, firebase, Jest, Nightmare, and more
Stars: ✭ 132 (+371.43%)
Mutual labels:  angularjs, angular2
Angular2
Angular 2 Seed
Stars: ✭ 75 (+167.86%)
Mutual labels:  angularjs, angular2
Angular2 Questionnaire
Angular Programming Book Part 3 Demo
Stars: ✭ 86 (+207.14%)
Mutual labels:  angularjs, angular2
Angular Prest
pREST component for Angular
Stars: ✭ 16 (-42.86%)
Mutual labels:  angularjs, angular2
Blog
lizhonghui's blog
Stars: ✭ 109 (+289.29%)
Mutual labels:  angularjs, angular2
Clever Bootstrap 4 Admin Template With Angularjs Angular 2 Support
Clever is Boostrap 4 Admin Template with Angular 2 and AngularJS support
Stars: ✭ 98 (+250%)
Mutual labels:  angularjs, angular2
Ngautocomplete
Light-weight autocomplete component for Angular.
Stars: ✭ 52 (+85.71%)
Mutual labels:  angularjs, angular2
Angular5 Seed
Angular5 Seed for Application
Stars: ✭ 222 (+692.86%)
Mutual labels:  angularjs, angular2
Angular Gridster2
Angular gridster 2
Stars: ✭ 956 (+3314.29%)
Mutual labels:  angularjs, angular2
Angular2 Demo
A simple demo for Angular 2
Stars: ✭ 77 (+175%)
Mutual labels:  angularjs, angular2
Angular Token Auth Seed
Stars: ✭ 20 (-28.57%)
Mutual labels:  angularjs, angular2
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+4403.57%)
Mutual labels:  angularjs, angular2
Angular-Firebase-Sortable-Table
Angular Firebase Sortable Table is a module that makes tables creation with firebase an easy task.
Stars: ✭ 28 (+0%)
Mutual labels:  angularjs, angular2
Codebe
CodeBe(码币)是一个是使用angular2整合各种插件的项目,包括(layer,bootstrap-table,markdown编辑器,highcharts,ckeditor,高德地图,fullcalendar 等等)。如果你有什么想要集成的插件,请告诉我,我来加进去。(请给我加个星,谢谢。)
Stars: ✭ 307 (+996.43%)
Mutual labels:  angularjs, angular2
Ion Digit Keyboard V2
A digital keyboard plugin to use in Ionic 2 applications.
Stars: ✭ 97 (+246.43%)
Mutual labels:  angularjs, angular2
Angular2 Express Mongoose Gulp Node Typescript
AngularJS 2 (Updated to 4.2.0) Mean Stack application which uses Angular2, Gulp, Express, Node, MongoDB (Mongoose) with Repository Pattern Business Layer
Stars: ✭ 201 (+617.86%)
Mutual labels:  angularjs, angular2

REPO DEPRECATED

Please note that this repo has been deprecated. Code and issues are being migrated to a monorepo at https://github.com/angular-redux/platform where we are beginning work on a new and improved v10. To file any new issues or see the state of the current code base, we would love to see you there! Thanks for your support!

@angular-redux/router

Join the chat at https://gitter.im/angular-redux/ng2-redux npm version downloads per month

Bindings to connect @angular/router to @angular-redux/core

Which version should I use?

For use with Angular 6: Use v9.

For use with Angular 5: Use v7.

For use with Angular 2-4: Use v6.

Setup

  1. Use npm to install the bindings:
npm install @angular-redux/router --save
  1. Use the routerReducer when providing Store:
import { combineReducers } from 'redux';
import { routerReducer } from '@angular-redux/router';

export default combineReducers<IAppState>({
  // your reducers..
  router: routerReducer
});
  1. Add the bindings to your root module.
import { NgModule } from '@angular/core';
import { NgReduxModule, NgRedux } from '@angular-redux/core';
import { NgReduxRouterModule, NgReduxRouter } from '@angular-redux/router';
import { RouterModule } from '@angular/router';
import { routes } from './routes';

@NgModule({
  imports: [
    RouterModule.forRoot(routes),
    NgReduxModule,
    NgReduxRouterModule.forRoot()
    // ...your imports
  ],
  // Other stuff..
})
export class AppModule {
  constructor(
    ngRedux: NgRedux<IAppState>,
    ngReduxRouter: NgReduxRouter
  ) {
    ngRedux.configureStore(/* args */);
    ngReduxRouter.initialize(/* args */);
  }
}

What if I use Immutable.js with my Redux store?

When using a wrapper for your store's state, such as Immutable.js, you will need to change two things from the standard setup:

  1. Provide your own reducer function that will receive actions of type UPDATE_LOCATION and return the payload merged into state.
  2. Pass a selector to access the payload state and convert it to a JS object via the selectLocationFromState option on NgReduxRouter's initialize().

These two hooks will allow you to store the state that this library uses in whatever format or wrapper you would like.

What if I have a different way of supplying the current URL of the page?

Depending on your app's needs. It may need to supply the current URL of the page differently than directly through the router. This can be achieved by initializing the bindings with a second argument: urlState$. The urlState$ argument lets you give NgReduxRouter an Observable<string> of the current URL of the page. If this argument is not given to the bindings, it defaults to subscribing to the @angular/router's events, and getting the URL from there.

Examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].