Where should my Javascript go for View Components?
<p>I'm getting used to <a href="http://docs.asp.net/projects/mvc/en/latest/views/view-components.html" rel="noreferrer">view components</a> in MVC 6, and I asked a <a href="https://stackoverflow.com/q/13994923/27457">similar question</a> a few years ago about partial views.  If I build a view component encapsulating a common use-case that requires its own Javascript, where do I put that Javascript?  I know that it is <a href="https://stackoverflow.com/q/912755/27457">dangerous at best</a> to have Javascript in partial views, but it would be a lot simpler to include it in the view component, rather than in the containing view or a separate file that has to be referenced by the containing view.</p>

<p>For example, say I have a view component that has two drop-downs.  The selection in the first drop-down determines what items appear in the second drop-down.  This is easily handled in Javascript, of course, but where do I put it?</p>