Routing in Ember.js

One of the distinguishing features of Ember is the heavy emphasis it puts on URLs. In many other frameworks, having separate URLs for separate screens is either lacking or is tacked on as an afterthought. In Ember, the router is the component that manages urls and transitions between them. Ember Routing Guides: http://emberjs.com/guides/routing/(link) Ember.Route class details: http://emberjs.com/api/classes/Ember.Route.html(link) Here we will take a look at different ways of adding routes: Dynamic Segments in Routes: A dynamic segment is a portion of a URL that starts with a

Ember Computed Properties

Ember computed property is the most powerful thing ember has and here we are going to get overview of how we can make use of these properties. Ember guides has explained it very nice way, and here I would like to add some more.. Bind property to nested resources Many times we need to depend on nested resources for ex: Find the count of comments or likes for post OR find number of items in cart etc. Here we want to update property as its nested resource is changed. Consider example: here we have property itemCount on cart, which should

Numeric input in Ember.js

Easy way to create a numeric input, which accepts only numbers (i.e. 0-9 and no other characters). app/components/numeric-input.js import Ember from 'ember'; export default Ember.TextField.extend({ tagName: "input", type: "number", attributeBindings: [ "name", "type", "value", "maxlength", "id" ], keyDown: function(e) { var key = e.charCode || e.keyCode || 0; // allow enter, backspace, tab, delete, numbers, keypad numbers, home, end only. return ( key === 13 || key === 8 || key === 9 || key === 46 || (key >= 35 && key = 48 && key = 96 && key And in your template, call it as {{numeric-input value=mobilePhone name="mobilePhone" id="mobile" maxlength="8" }} As the number input displays up

Integration of jquery-timeago in ember application

Timeago is a widely used jQuery plugin which makes it easy to support automatically updating timestamps. (ex: 2 minutes ago) plugin documentation: http://timeago.yarp.com/(link) Now we will see how to integrate timeago jquery plugin in ember application. (Here we will give example using ember-cli) install jquery-timeago plugin using bower bower install jquery-timeago In Brocfile.js app.import('bower_components/jquery-timeago/jquery.timeago.js'); Create Ember Component to display time format app/components/time-ago.js import Ember from 'ember'; export default Ember.Component.extend({ timeValue: new Date(), didInsertElement: function() { Ember.$().ready(function (){ Ember.$('time.timeago').timeago(); // update every