Working on any interface, it is important to let the user know that their actions are doing something. Nothing would is worse than clicking a save button and wondering to yourself, “did it save?”.
Ember.js is an excellent platform for creating web applications but unless you go out of your way to display that a record is updating, the user will never know. This is where a loading button view comes into play.
I’ve went ahead and created a button that will bind to a true/false value and listen for any changes. In addition, we are able to bind actions to the button by implementing “ViewTargetActionSupport” in our Ember.View; this means that it can retain its default HTML functionality of binding actions.
By default, this button uses font-awesome to render a loading spinner, but you can change the template to display whatever you need. The initial “Save” text is editable as a passed parameter to the Handlebar’s view.
Your new post is loading...