-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Unfortunately I couldn't create a working example with your tutorial because Ember.Object.extend does not work, is it outdated?
So I have the following:
App.User = DS.Model.extend(Ember.Validations, {
validations: {
firstname: {
presence: true
}
}
}My Controller which handles the user object which is created by user input (form elements):
App.IndexController = Ember.Controller.extend({
actions: {
register: function(){
var user = this.get('model');
user.validate();
}
}
});At that moment I get the error: Uncaught TypeError: Object [object Object] has no method 'validate'
What have I done wrong? Bug? Thx for help.
For your information, why Ember.Object.extend does not work, I get the following error then:
Assertion failed: Expected hash or Mixin instance, got [object Undefined] ember.js:394
DEPRECATION: Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object (error on <App.ApplicationRoute:ember230>)
at Object.triggerEvent (http://localhost:9000/bower_components/ember/ember.js:30519:13)
at trigger (http://localhost:9000/bower_components/ember/ember.js:29641:16)
at handleError (http://localhost:9000/bower_components/ember/ember.js:29903:9)
at invokeCallback (http://localhost:9000/bower_components/ember/ember.js:8055:19)
at null.<anonymous> (http://localhost:9000/bower_components/ember/ember.js:8109:11)
at EventTarget.trigger (http://localhost:9000/bower_components/ember/ember.js:7878:22)
at http://localhost:9000/bower_components/ember/ember.js:8180:17
at Object.DeferredActionQueues.flush (http://localhost:9000/bower_components/ember/ember.js:5459:24)
at Object.Backburner.end (http://localhost:9000/bower_components/ember/ember.js:5545:27)
Reactions are currently unavailable