Dependency Injection

Dependency Injection Ember applications utilize the dependency injection ("DI") design pattern to declare and instantiate classes of objects and dependencies between them. Applications and application instances each serve a role in Ember's DI implementation. An Ember.Application serves as a "registry" for dependency declarations. Factories (i.e. classes) are registered with an application, as well as rules about "injecting" dependencies that are applied when objects are instantiated. An Ember

DefaultResolver#_logLookup()

_logLookup (found, parsedName) private Defined in packages/ember-application/lib/system/resolver.js:399 Parameters: found Boolean parsedName Object

Defining Models

Defining Models A model is a class that defines the properties and behavior of the data that you present to the user. Anything that the user expects to see if they leave your app and come back later (or if they refresh the page) should be represented by a model. When you want a new model for your application you need to create a new file under the models folder and extend from DS.Model. This is more conveniently done by using one of Ember CLI's generator commands. For instance, let's create a

DefaultResolver#useRouterNaming()

useRouterNaming (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:286 Given a parseName object (output from parseName), apply the conventions expected by Ember.Router Parameters: parsedName Object a parseName object with the parsed fullName lookup string

Defining a Component

Defining a Component To define a component, run: ember generate component my-component-name Components must have at least one dash in their name. So blog-post is an acceptable name, and so is audio-player-controls, but post is not. This prevents clashes with current or future HTML element names, aligns Ember components with the W3C Custom Elements spec, and ensures Ember detects the components automatically. A sample component template could look like this: app/templates/components/blog-post

DefaultResolver#translateToContainerFullname()

translateToContainerFullname (type, name) private Defined in packages/ember-application/lib/system/resolver.js:450 Converts provided name from the backing namespace into a container lookup name. Examples: App.FooBarHelper -> helper:foo-bar App.THelper -> helper:t Parameters: type String name String

DefaultResolver#resolveTemplate()

resolveTemplate (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:301 Look up the template in Ember.TEMPLATES Parameters: parsedName Object a parseName object with the parsed fullName lookup string

DefaultResolver#resolveOther()

resolveOther (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:379 Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application) Parameters: parsedName Object a parseName object with the parsed fullName lookup string

DefaultResolver#resolveView()

resolveView (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:315 Lookup the view using resolveOther Parameters: parsedName Object a parseName object with the parsed fullName lookup string

DefaultResolver#resolveRoute()

resolveRoute (parsedName) protected Defined in packages/ember-application/lib/system/resolver.js:340 Lookup the route using resolveOther Parameters: parsedName Object a parseName object with the parsed fullName lookup string