// server side
$.post( "http://localhost:5425/app/v1/present", data)
.done(function( representation ) {
$( "#representation" ).html( representation );
}
);
var actions = {} ;
actions.edit = function(data) {
data.lastEdited = {title: data.title, description: data.description, id: data.id } ;
present(data) ;
return false ;
} ;
actions.save = function(data) {
data.item = {title: data.title, description: data.description, id: data.id || null} ;
present(data) ;
return false ;
} ;
actions.delete = function(data) {
data = {deletedItemId: data.id} ;
present(data) ;
return false ;
} ;
actions.cancel = function(data) {
present(data) ;
return false ;
} ;
I want to change color (for example) of my view-component and I would like to select this component from DOM
You should not do that, the whole point of V = f(M) is that you (almost) never manipulate the DOM, the color should be part of the model and when you generate the stateRepresentation based on the new application state.