dagstuan / ng2-redux-router

Bindings to connect @angular/router to ng2-redux
MIT License
19 stars 11 forks source link

Add angular router's NavigationExtras support #8

Open rafabernad opened 8 years ago

rafabernad commented 8 years ago

Current implementation discards the rich parametrized navigation that angular router supports with NavigationExtras.

This PR enables using Navigation extras within the payload while keeping compatibility with the current implementation, enabling dispatching events with richer payloads.

rafabernad commented 8 years ago

I'll update package dependencies and make a new pull request with them

dagstuan commented 8 years ago

What is your indended use case for this implementation? Dispatching router actions through the library?

Since ng2-redux prefers the use of injectables as action creators instead of plain javascript objects, I figured most people would just inject the router in the injectable actions and send commands directly through it, instead of going through my library. But maybe your use case is different and your need to dispatch an action directly through this library?

rafabernad commented 8 years ago

Yeah, exactly that.

Of course, you can always inject the router and dispatch route changes throught it, but think it doesn't hurt enabling your library to receive actions with options on it.