ember-previous
v0.0.3
Published
ember addon to expose previous router states
Downloads
4
Keywords
Readme
ember-previous
An addon for exposing some useful states of the ember router.
Add the PreviousMixin
to your app router:
...
import PreviousMixin from 'ember-previous/mixins/previous';
const Router = Ember.Router.extend(PreviousMixin, {
...
});
You'll have access to a previous
object on all your routes.
// routes/foo.js
import Ember from 'ember';
export default Ember.Route.extend({
setupController(controller) {
this._super(...arguments);
let {
path, // foo.bar
url, // foo/bar
route // foo.bar
} = this.get('previous');
controller.setProperties({ path, url, route });
}
});
Installation
git clone <repository-url>
this repositorycd ember-previous
npm install
Running
ember serve
- Visit your app at http://localhost:4200.
Running Tests
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit https://ember-cli.com/.