February 2016
Beginner to intermediate
308 pages
5h 46m
English
The dependency injection pattern is used to declare and instantiate classes of objects and handle dependencies between them. In Ember, we can take objects or services and inject them into routes, controllers, or components.
In this recipe, we'll take a logger object and inject it into our controllers using dependency injection.
moment library and create a new initializer:$ bower install moment –save $ ember g initializer application
This will install the Bower Moment.js library. We'll use this for our custom logger.
// ember-cli-build.js /*jshint node:true*/ /* global require, module */ var EmberApp = require('ember-cli/lib/broccoli/ember-app'); ...Read now
Unlock full access