public
Created

Basic Ember.js Model

  • Download Gist
computed_property_model.coffee
CoffeeScript
1 2 3 4 5 6 7
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')
gistfile1.coffee
CoffeeScript
1 2 3
user = App.UserSignUpModel.create
name: 'Jonathan Conway'
email: 'test@test.com'
model.coffee
CoffeeScript
1 2 3
App.UserSignUpModel = Em.Object.extend
name: null
email: null

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.