O'Reilly logo

Ember.js Cookbook by Erik Hanchett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and working with add-ons

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.

How to do it...

  1. Create a new add-on called sockjs-chat. Generate these files:
    $ ember addon sockjs-chat
    $ cd sockjs-chat
    $ ember g component sockjs-chat ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required