Defining Your Routes

Defining Your Routes When your application starts, the router matches the current URL to the routes that you've defined. The routes, in turn, are responsible for displaying templates, loading data, and setting up application state. To define a route, run ember generate route route-name This creates a route file at app/routes/route-name.js, a template for the route at app/templates/route-name.hbs, and a unit test file at tests/unit/routes/route-name-test.js. It also adds the route to the rout

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

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#_logLookup()

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

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

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#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#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#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

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