Skip to content

Instantly share code, notes, and snippets.

@jaikoo
Created January 28, 2012 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaikoo/1694042 to your computer and use it in GitHub Desktop.
Save jaikoo/1694042 to your computer and use it in GitHub Desktop.
Basic Ember.js Model
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')
user = App.UserSignUpModel.create
name: 'Jonathan Conway'
email: 'test@test.com'
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