Skip to content

Instantly share code, notes, and snippets.

@cocodrino
Created July 19, 2012 04:06
Show Gist options
  • Select an option

  • Save cocodrino/3140683 to your computer and use it in GitHub Desktop.

Select an option

Save cocodrino/3140683 to your computer and use it in GitHub Desktop.
where is the mistake!! :D
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