Include javascript in plugin app

Re: Include javascript in plugin app

by Mark Johnson -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Pretty much, yes.

Getting in to the nitty-gritty a bit more, the app uses and angular component to display the page for your plugin, and the 'javascript' string returned is executed in the scope of that component. So if the javascript defines a method or property of this, the method or property is then part of that component, and available to be referenced from the template. If it has contains other arbitrary code, that will be executed within the scope of the component when it is loaded.

In reply to Mark Johnson

Re: Include javascript in plugin app

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Okay. So, in the existing web code, I have a function that deselects some options when an other option is selected. The "this" would deal with the one that was selected, but then I need to find the other elements and deselect them. In the web code, I would get all of the elements of that input type, cycle through them looking for known identifiers and names, and then deselect the ones that match.

How would I do that type of location?