The application I create uses Ember.js and Raphael.js. Since I am new to Ember.js, I am having trouble understanding how to link them together. I have already seen this demo , but it only helps me with this.
Let me tell you about my question as follows:
As an example, take the todo demo from the Ember.js documentation . How can I associate an image with each todo element and display that image on the Raphael drawing canvas when the todo object is not completed? To clarify, there is only 1 Raphael drawing surface where the all images.
As in the demo version of Ember.js, I would like to use fixtures for my todo information, but I would like to add an image field:
Todos.Todo.FIXTURES = [ { id: 1, title: 'Learn Ember.js', isCompleted: true, image: 'some.png' }, { id: 2, title: '...', isCompleted: false, image: 'some_other.png' } ];
Please be patient with me, as I did not have much impact on Ember.js. I need to know
- Where and how to initialize Raphael's drawing surface
- How to add images to the surface of a drawing,
- How to switch the visibility of an image based on a related task isCompleted value.
clone45
source share