HashLocation#getURL()

getURLprivate Defined in packages/ember-routing/lib/location/hash_location.js:42 Returns the normalized URL, constructed from location.hash. e.g. #/foo => /foo as well as #/foo#bar => /foo#bar. By convention, hashed paths must begin with a forward slash, otherwise they are not treated as a path so we can distinguish intent.

HashLocation#getHash()

getHashprivate Defined in packages/ember-routing/lib/location/hash_location.js:32 Available since 1.5.1

HashLocation#formatURL()

formatURL (url) private Defined in packages/ember-routing/lib/location/hash_location.js:123 Given a URL, formats it to be placed into the page as part of an element's href attribute. This is used, for example, when using the {{action}} helper to generate a URL based on an event. Parameters: url String

HashLocation

Ember.HashLocation Class PRIVATE Extends: Ember.Object Defined in: packages/ember-routing/lib/location/hash_location.js:15 Module: ember-routing Ember.HashLocation implements the location API using the browser's hash. At present, it relies on a hashchange event existing in the browser.

Handling Metadata

Handling Metadata Along with the records returned from your store, you'll likely need to handle some kind of metadata. Metadata is data that goes along with a specific model or type instead of a record. Pagination is a common example of using metadata. Imagine a blog with far more posts than you can display at once. You might query it like so: let result = this.get('store').query('post', { limit: 10, offset: 0 }); To get different pages of data, you'd simply change your offset in increme

Handling Events

Handling Events You can respond to user events on your component like double-clicking, hovering, and key presses through event handlers. Simply implement the name of the event you want to respond to as a method on your component. For example, imagine we have a template like this: {{#double-clickable}} This is a double clickable area! {{/double-clickable}} Let's implement double-clickable such that when it is clicked, an alert is displayed: app/components/double-clickable.js import Ember fr

Handling Deprecations

Handling Deprecations A valuable attribute of the Ember framework is its use of Semantic Versioning to aid projects in keeping up with changes to the framework. Before any functionality or API is removed it first goes through a deprecation period where the functionality is still supported, but usage of it generates a warning logged to the browser console. These warnings can pile up between major releases to a point where the amount of deprecation warnings that scroll through the console becom

Handlebars Basics

Handlebars Basics Ember uses the Handlebars templating library to power your app's user interface. Handlebars templates contain static HTML and dynamic content inside Handlebars expressions, which are invoked with double curly braces: {{}}. Dynamic content inside a Handlebars expression is rendered with data-binding. This means if you update a property, your usage of that property in a template will be automatically updated to the latest value. Displaying Properties Templates are backed with

Function#property()

propertypublic Defined in packages/ember-runtime/lib/ext/function.js:15 The property extension of Javascript's Function prototype is available when EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Function is true, which is the default. Computed properties allow you to treat a function like a property: MyApp.President = Ember.Object.extend({ firstName: '', lastName: '', fullName: function() { return this.get('firstName') + ' ' + this.get('lastName'); }.property() // Ca

Function#on()

onpublic Defined in packages/ember-runtime/lib/ext/function.js:162 The on extension of Javascript's Function prototype is available when EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Function is true, which is the default. You can listen for events simply by adding the on call to the end of your method declarations in classes or mixins that you write. For example: Ember.Mixin.create({ doSomethingWithElement: function() { // Executes whenever the "didInsertElement" event fir