-
-
Save sheriffderek/f44a48607738a0b9af81 to your computer and use it in GitHub Desktop.
StackOverFlow-32855039
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
import Ember from 'ember'; | |
// model is in the route | |
export default Ember.Controller.extend( { | |
actions: { | |
showCover(book) { | |
book.set('coverVisible', true); | |
console.log(book.coverVisible); | |
} | |
} | |
}); | |
// route = 'this' > model > books > book > coverVisible |
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
import Ember from 'ember'; | |
var bookData = [ | |
{ | |
name: "Book1", | |
thing: 'all at the same time :(', | |
coverVisible: false | |
}, | |
{ | |
name: "Book2", | |
thing: 'all at the same time :(', | |
coverVisible: false | |
}, | |
{ | |
name: "Book3", | |
thing: 'all at the same time :(', | |
coverVisible: false | |
} | |
]; | |
export default Ember.Route.extend({ | |
model() { | |
return bookData; | |
} | |
}); |
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
import DS from 'ember-data'; | |
var type = function(input) { | |
return DS.attr(input); | |
}; | |
export default DS.Model.extend({ | |
name: type('string'), | |
thing: type('string'), | |
readingReview: type('boolean') | |
}); |
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
{ | |
"version": "0.4.11", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.11/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment