What is the purpose of withResource & inView?

Hi there, sorry for what is probably a really basic question. I have read the docs and can’t answer this yet.

I’m confused what the purpose of these methods are. I have seen working examples putting the controller (JS, TS etc) in withResource, other examples of putting the view (.html) file in there.

Is the notion of a resource both javascript and view layer? If I put the view in withResource why do I also need inView?

Also another question, some of the code that I’m trying to test is using class.bind which I’m finding to be problematic when testing as I can’t seem to get the component to bind the class, instead a fatal error occurs.

1 Like

regarding the question about class.
you can do: (ive mixed some usages in the same example - use what you need)

<div class="some-static-class ${someBoundedClass} ${shouldAddOtherClass ? 'other-class' : ''}"></div>