Created
January 28, 2012 11:43
-
-
Save jaikoo/1694042 to your computer and use it in GitHub Desktop.
Basic Ember.js Model
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.UserSignUpModel = Em.Object.extend | |
name: null | |
email: null | |
isValidEmail: () -> | |
validEmailRegex = new RegExp ”^[0-9a-zA-Z]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$” | |
validEmailRegex.test(@get('email')) | |
.property('email') |
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
user = App.UserSignUpModel.create | |
name: 'Jonathan Conway' | |
email: '[email protected]' |
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.UserSignUpModel = Em.Object.extend | |
name: null | |
email: null | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment