Mario Gomez
Mario Gomez

Reputation: 139

Add custom library in ember

I have a plain custom library that I want to add to my ember project. I need to use it across multiple controllers and routes, what is the standard way to do that? lib folder? as a helper? export as module?

Upvotes: 0

Views: 641

Answers (1)

dwickern
dwickern

Reputation: 3519

I assume by "plain" you mean the library is not written against ember, node, AMD, ES6 or anything else-- just plain JS.

Put your libarary into the vendor directory, then add this line in your ember-cli-build.js:

app.import('vendor/your-library.js');

Then you can access it globally.

Read more here: http://www.ember-cli.com/user-guide/#standard-non-amd-asset

Upvotes: 1

Related Questions