is there any way for the binder to get data from the controller that is not in the view?
I haven't found a way for the binder to receive information directly from the controller without it being inserted somehow into the DOM like:
<script>var xxx = {{{extraData}}}</script> or adding extra attributes to DOM nodes or concatenating stuff into the className of elements, like:
<input name="field1" value="{{field1}}" class="{{field1validation}}" />
I can add such information to the class attribute of the <input> boxes as shown above, which is not terribly bad. However, for more extensive amounts of information, this is needlessly complicated and slow since accessing the DOM is never cheap.
Basically what I mean is that I would like to be able to read the very same first argument of ac.done(data) as the template processor gets it.
I realize that this might not be cheap since the template might have been processed in the server so providing such data, if large enough, might duplicate the amount of data transferred. Perhaps a better solution would be to do something like:
ac.done(data, {binder:{data:extraData}});
So that the developer can explicitly say which data needs to be provided to the binder.
by
1 Reply