
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wtc-controller-element
Advanced tools
$ npm install wtc-controller-element --save
ExecuteController is a static class used to register and instanciate controllers extended from the ElementController class.
Inside your module, BEFORE exporting it:
// Register
ExecuteControllers.registerController(TestController, '[Name]');
As a convention, please use the name as the same name of the controller.
There are 2 options, but first, import it:
import {ExecuteControllers} from 'wtc-controller-element';
This will instanciate all elements with a [data-controller] attribute.
ExecuteControllers.instanciateAll();
Just pass in the element and the name of the registered controller or the controller itself.
ExecuteControllers.instanciate(document.getElementById('id'), ['TestController'|TestController]);
ElementController is the base class for controllers that alter DOM elements. It's responsible for saving the state and the instance of the controller for easy reference.
Import and extend it in your module.
import {default as ElementController, ExecuteControllers} from 'wtc-controller-element';
class TestController extends ElementController {
constructor(element) {
super(element);
}
}
/* Don't forget to register it */
ExecuteControllers.registerController(TestController, 'TestController');
bower version is DEPRECATED and is here for older projects.
Please use the new ES6 module if possible.
bower install wtc-controller-element
Simply extend it on your controller function.
FAQs
Generic element controller. Binds an element to a controller.
We found that wtc-controller-element demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.