Created
June 9, 2015 15:26
-
-
Save kalyco/b8224344d411843ddd29 to your computer and use it in GitHub Desktop.
ember controllers are different from rails controllers in that their primary function is to provide the logic to access data from the model. In this example, the user has different first_name, last_name properties, but wants to show a full name. This is something that a controller would be used for.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.UserController = Ember.Object.Controller.extend({ | |
fullName: function() { | |
return this.get("first_name") + " " + this.get("last_name"); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment