Here is the quick snippet.
First, install the library with bower. bower install store-js --save

Now edit ember-cli-build.js file and import the library there.

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  ...
  // Use app.import to add additional libraries to the generated
  // output files.

  //Javascript files.
  app.import("bower_components/store-js/dist/store.legacy.min.js");

  return app.toTree();
};

Now you can use the library anywhere inside ember by its namespace. In store.js case, it is store.

import Ember from 'ember';

const StorageHandler = Ember.Object.extend({

  get(name) {
    console.log('store get will be called');
    return store.get(name);
  }
}

leave a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.