Ember has a common way of sharing code using something called Ember Addons (also known as add-ons). Ember Addons make it easy to distribute reusable libraries with other applications. Anyone can create add-ons. You can publish them to NPM or to your own private Git repository.
Keep in mind that you can also use Bower to install frontend dependencies. This is done through the Bower package manager. Take a look at Chapter 1, Ember CLI Basics for more information on how to do this.
In this recipe, we'll take our chat program from the last section and make it an add-on.
Create a new add-on called
sockjs-chat
. Generate these files:$ ember addon sockjs-chat $ cd sockjs-chat $ ember g component sockjs-chat $ ember g service sockjs $ ember g blueprint sockjs-chat $ npm install ember-cli-htmlbars --save
The
ember addon
command generates the folder structure for the add-on. We'll discuss the folder structure in more detail later. Theblueprint
command...