String#dasherize()

dasherize (str) Stringpublic Defined in packages/ember-runtime/lib/system/string.js:245 Replaces underscores, spaces, or camelCase with dashes. 'innerHTML'.dasherize(); // 'inner-html' 'action_name'.dasherize(); // 'action-name' 'css-class-name'.dasherize(); // 'css-class-name' 'my favorite items'.dasherize(); // 'my-favorite-items' 'privateDocs/ownerInvoice'.dasherize(); // 'private-docs/owner-invoice' Parameters: str String The string to dasherize. Returns:

String#decamelize()

decamelize (str) Stringpublic Defined in packages/ember-runtime/lib/system/string.js:228 Converts a camelized string into all lower case separated by underscores. 'innerHTML'.decamelize(); // 'inner_html' 'action_name'.decamelize(); // 'action_name' 'css-class-name'.decamelize(); // 'css-class-name' 'my favorite items'.decamelize(); // 'my favorite items' Parameters: str String The string to decamelize. Returns: String the decamelized string.

String#camelize()

camelize (str) Stringpublic Defined in packages/ember-runtime/lib/system/string.js:263 Returns the lowerCamelCase form of a string. 'innerHTML'.camelize(); // 'innerHTML' 'action_name'.camelize(); // 'actionName' 'css-class-name'.camelize(); // 'cssClassName' 'my favorite items'.camelize(); // 'myFavoriteItems' 'My Favorite Items'.camelize(); // 'myFavoriteItems' 'private-docs/owner-invoice'.camelize(); // 'privateDocs/ownerInvoice' Parameters: str String The str

String

Ember.String Namespace PUBLIC Defined in: packages/ember-runtime/lib/system/string.js:144 Module: ember-runtime Defines string helper methods including string formatting and localization. Unless EmberENV.EXTEND_PROTOTYPES.String is false these methods will also be added to the String.prototype as well.

String#capitalize()

capitalize (str) Stringpublic Defined in packages/ember-runtime/lib/system/string.js:319 Returns the Capitalized form of a string 'innerHTML'.capitalize() // 'InnerHTML' 'action_name'.capitalize() // 'Action_name' 'css-class-name'.capitalize() // 'Css-class-name' 'my favorite items'.capitalize() // 'My favorite items' 'privateDocs/ownerInvoice'.capitalize(); // 'PrivateDocs/ownerInvoice' Parameters: str String The string to capitalize. Returns: String The capita

String#classify()

classify (str) Stringpublic Defined in packages/ember-runtime/lib/system/string.js:282 Returns the UpperCamelCase form of a string. 'innerHTML'.classify(); // 'InnerHTML' 'action_name'.classify(); // 'ActionName' 'css-class-name'.classify(); // 'CssClassName' 'my favorite items'.classify(); // 'MyFavoriteItems' 'private-docs/owner-invoice'.classify(); // 'PrivateDocs/OwnerInvoice' Parameters: str String the string to classify Returns: String the classified s

Specifying a Route's Model

Specifying a Route's Model Often, you'll want a template to display data from a model. Loading the appropriate model is one job of a route. For example, take this router: app/router.js Router.map(function() { this.route('favorite-posts'); }); To load a model for the favorite-posts route, you would use the model() hook in the favorite-posts route handler: app/routes/favorite-posts.js import Ember from 'ember'; export default Ember.Route.extend({ model() { return this.get('store').que

Services and Utilities

Services and Utilities For Super Rentals, we want to be able to display a map showing where each rental is. To implement this feature, we will take advantage of several Ember concepts: A component to display a map on each rental listing. A service to keep a cache of rendered maps to use in different places in the application. A utility function to create a map from the Google Maps API. We'll start by displaying the map and work our way back to using the Google Map API. Display Maps With a C

Setting Up Tests

Setting Up Tests To demonstrate the basic setup and processing of an Ember application, this section will walk through building an Ember application for a property rental site called Super Rentals. It will start with a homepage, an about page and a contact page. Here's a look at the desired application before we get started. Let's think through what we want to do on the home page of our Super Rentals application. We want our application to: List available rentals. Link to information about t

Specifying the URL Type

Specifying the URL Type The Ember router has four options to manage your application's URL: history, which uses the HTML5 History API; hash, which uses anchor-based URLs; auto, which uses history if supported by the user's browser, and falls back to hash otherwise; and none, which doesn't update the URL. By default, Ember CLI configures the router to use auto. You can change this option in config/environment.js under ENV.locationType. history When using history, Ember uses the browser's histo