Skip to content

Instantly share code, notes, and snippets.

@ckung
Last active August 29, 2015 14:02
Show Gist options
  • Save ckung/9182d5f5e39bb783d6c8 to your computer and use it in GitHub Desktop.
Save ckung/9182d5f5e39bb783d6c8 to your computer and use it in GitHub Desktop.
var Quiz = Ember.Object.extend({});
var QuizRoute = Ember.Route.exted({
model: function() {
return $.ajax();
},
setupController: function(model, controller) {
//model = {id: 1}
//controller is App.QuizController
var quiz = Quiz.create(model);
// quiz.set('question1', 'blah'); //trigger an event
//Ember.set(model, 'question1', 'blah');
controller.set('model', quiz);
}
})
App.QuizController.extend({});
var QuizView = Ember.View.extend({
templateName: function(){
var type = this.get('controller.content.type');
//DO SWITCH
switch(type){
case 'long':
return 'long-quiz'
}
}.property()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment