ember-previous

0.0.3 • Public • Published

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 repository
  • cd ember-previous
  • npm install

Running

Running Tests

  • npm test (Runs ember 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/.

Readme

Keywords

Package Sidebar

Install

npm i ember-previous

Weekly Downloads

29

Version

0.0.3

License

MIT

Last publish

Collaborators

  • mikehearn
  • dianaparrington
  • jjnypr
  • nypr