ui-router / dsr Goto Github PK
View Code? Open in Web Editor NEWDeep State Redirect for UI-Router 1.0
License: MIT License
Deep State Redirect for UI-Router 1.0
License: MIT License
Thanks UI router team and @christopherthielen for updating DSR to work with UI-Router 1.x!
I didn't see any note on usage with AngularJS, but this is what I'm using with v1.6:
/**
* @module $deepStateRedirect
*/
import angular from 'angular';
import uiRouter from '@uirouter/angularjs';
import { DSRPlugin } from '@uirouter/dsr';
export const name = 'ct.ui.router.extras.dsr';
export default angular.module(name, [uiRouter])
.provider('$deepStateRedirect', $uiRouterProvider => {
'ngInject';
const $deepStateRedirect = $uiRouterProvider.plugin(DSRPlugin);
Object.defineProperty($deepStateRedirect, '$get', {
value: () => $deepStateRedirect,
});
return $deepStateRedirect;
})
.config($deepStateRedirectProvider => {
'ngInject';
})
.run($deepStateRedirect => {
'ngInject';
})
.name;
Would be nice to have some documentation (per #5) explaining AngularJS (and other integrations), or even include integrations in this repo.
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
We use ui-router/dsr
in our angularJs frontends and are impacted by Issue #2
I just noticed that the issue has already been closed and is in the 1.0.3 milestone - which does not contain further issues.
Would you mind doing a release of that to npmjs.com
registry? This would simplify working around that problem heavily for us. I'd like to avoid to npm install ui-router/dsr
directly from github or creating a fork just to publish with a different name.
This is an exact FR as @joeljeske asked on the ui-router-extras
project
It would be nice to have an option that would seamlessly persist the DSR states to local or session storage. This would allow an application to "remember" the most recently viewed area of the app and restore it.
Hi,
We'd love to use this but I couldn't find an NPM package. Any chance you could publish one?
Thanks for all the great work, @christopherthielen !
Cheers
The docs from http://christopherthielen.github.io/ui-router-extras/#/dsr should be reformatted and added to the README.md
I have included this library in a typescript project and tsc has started throwing compile errors because I'm using missing fields in StateDeclaration.
This doesn't happend with sticky-states which I've included before this one, so after looking at StateDeclaration overrides in two project I've seen that StateDeclaration it's defined with different module names:
StateDeclaration in @uirouter/dsr
declare module "@uirouter/core" {
interface StateDeclaration {
dsr?: any;
deepStateRedirect?: any;
}
}
StateDeclaration in @uirouter/sticky-states
declare module "@uirouter/core/lib/state/interface" {
interface StateDeclaration {
sticky?: boolean;
onInactivate?: TransitionStateHookFn;
onReactivate?: TransitionStateHookFn;
}
}
I suggest to modify this declaration to have the same module name as in sticky-states module, because with that change tsc would compile projects correctly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.