ViewModel API example confusing; unify HTML + JS via <script>?

Here is a screenshot of https://canjs.github.io/next/doc/can-component.prototype.ViewModel.html#CallingmethodsonViewModelfromeventswithintheview. I like that a working example is provided, but find it hard to follow because items in the text sample are changed in the working example.

On a related note, I wonder if the working examples would be easier to follow if the HTML and JS sections were combined into a single HTML section which uses <script> to embed the JS?

Thanks @code-read! Would you mind filing an issue in the can-component repo? https://github.com/canjs/can-component/issues/new

Filed; let me know if I didn’t file it properly. Thanks.

1 Like