Created
July 19, 2012 04:06
-
-
Save cocodrino/3140683 to your computer and use it in GitHub Desktop.
where is the mistake!! :D
This file contains hidden or 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
| original file : | |
| Welcome = Ember.Application.create({ | |
| ready: function(){ | |
| // alert('you did it!'); | |
| } | |
| }); | |
| Welcome.Book = Ember.Object.extend({ | |
| title: '', | |
| author: '', | |
| genre: '' | |
| }); | |
| Welcome.booksController = Ember.ArrayController.create({ | |
| content: [], | |
| loadBooks: function(){ | |
| var self = this; | |
| $.getJSON('data/books.json', function(data) { | |
| data.forEach(function(item){ | |
| self.pushObject(Welcome.Book.create(item)); | |
| }); | |
| }); | |
| } | |
| }); | |
| my file | |
| this.Welcome = Ember.Application.create( | |
| ready : -> | |
| ) | |
| this.Welcome.Book = Ember.Object.extend( | |
| title : "" | |
| autor : "" | |
| genre : "" | |
| ) | |
| this.Welcome.booksController = Ember.ArrayController.create( | |
| content : [] | |
| loadBooks : -> | |
| $.getJSON('data/books.json', (data) ~> | |
| data.forEach (item) -> | |
| this.pushObject(Welcome.Book.create(item)) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment