Last active
August 29, 2015 14:02
-
-
Save ckung/9182d5f5e39bb783d6c8 to your computer and use it in GitHub Desktop.
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
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