Hi All,
All of my viewModels have the appController added so i can reference things by calling app.functionName() or app.variable just fine.
My issue is trying to reach up to this while in a view. For example, I have a listView where I want to format a particular field, so I created a function in the appController.
I am trying something like:
<oj-bind-text
value="[[$root.formattedTime($current.data.timeVariable)]]">
</oj-bind-text>
That doesnt work as it doesnt like $root. If I add the formattedTime function to the viewModel the view uses then it works:
<oj-bind-text
value="[[formattedTime($current.data.timeVariable)]]">
</oj-bind-text>
I want to avoid copying this function to all the viewModels that need it. I gather I am missing something simple here, but it has plagued me for a while!
Thanks for any help.