Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb app architecture using Ember. Where should animation logic sit?
    primarykey
    data
    text
    <p>I am building a web app using Ember. Drag and drop ( and other animations such as automatic slide ) is a significant part of how the user will interact with the app. </p> <p>I've already decided all animation logic will sit by itself in an Ember mixin class vis a vis this blog:</p> <p><a href="http://www.dynopia.com/index.php/en/blog/article/771/ember-js-animations-with-jquery-animate" rel="nofollow">http://www.dynopia.com/index.php/en/blog/article/771/ember-js-animations-with-jquery-animate</a></p> <p>However, I am little confused whether I should have two Views per draggable element, one to render the element and one to handle the animation logic?</p> <p>In addition, after the animations is complete, the current css attributes of the element should be updated in its corresponding model. I can take care of this with a simple two way binding between view and model, ie:</p> <pre><code>/** element view **/ App.elemOneView = Ember.View.create({ name: 'element One', cssAttr: {}, ... }); /** element controller**/ App.elemController = Ember.ArrayController.create({ content: [], .... }); /** element model **/ App.elemOneModel = Ember.Model.create({ name: 'element one', cssAttrBinding: 'App.elemOneView.cssAttr' ... }); </code></pre> <p>My question is that it frowned upon that model is directly bound to view, even though there is a controller layer in between them? Should I have both view and model sync to an intermediate object?</p> <p>Note: currently, I plan on declaring view ( for animation logic ) and model ( to store css attributes, among other things ) for each element that appears on the page, so there will be lots of views and models. I should ask whether this is bad too?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload