model view controller - Javascript MVC Design Feedback -
i share design of mvc via js.
what think it? tried not use mvc framework want clear structure , decoupled organisation.
next step me evaluating require.js rid of ordering within index file
the code: http://nopaste.info/2547415f71_nl.html
i think should bind click events in view. controller can made "pure logic, no dom".
also, in view -
instead of
var uicomponents = { contactlist: "#contactlist" };
you -
var uicomponents = { contactlist: $("#contactlist") };
which traverse dom once , cache element use elsewhere.
model looks clean (no coupling view or controller).
Comments
Post a Comment