-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
we have a client side script which is parametrized by data in the view model. I'm sure it must be a very common case, but I can't figure out how to do that. I would like to try to use @load annotation to somehow fill some variable in my script, but the longer I'm thinking about it the more I'm afraid it's not possible. Do someone have some experience with that?
Hi Calavera,
Sorry, I can't understand your question. Can you provide pseudo code?
Regards,
Monty Pan
I have a solution for this already. The use case is that we have custom javascript-only implementation of calendar and we need to set disabled days on this calendar. Disabled days varies through different pages and is even dependent on data that user inputs. I used this construction:
<script>
function someCallback(dynamicData) {
alert(dynamicData);
}
</script>
<script content="@load(vm.selectedAccount) @converter(jsonDataConverter)">
<custom-attributes callbackName="someCallback"/>
</script>
And all the magic is done in the converter.
Asked: 2012-10-24 17:34:21 +0800
Seen: 153 times
Last updated: Oct 25 '12