Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
custom-element-decorator
Advanced tools
import {customElement} from 'custom-element-decorator';
@customElement()
class MySuperCoolElement extends HTMLElement {}
// Now you can use <my-super-cool-element> anywhere in your app.
Important note: The name of your class may change if you use a minifier, that means <my-super-cool-element>
in this example might be renamed to something else in the build. In most case it's fine and won't cause any trouble but if you want to force a name you should pass it as an argument:
@customElement({ name: 'my-super-cool-element' })
class MyElement extends HTMLElement {}
Sometimes you don't want to bother finding a special DOM location for your app's custom elements.
If you create the object programmatically into your code you can pass the inject
argument to automatically inject the object into the DOM.
import {customElement} from 'custom-element-decorator';
@customElement({ inject: true })
class MyServiceElement extends HTMLElement {}
// This object is automatically inserted inside the DOM
// upon creation.
export const service = new MyServiceElement();
npm add -D custom-element-decorator
import {customElement} from 'custom-element-decorator/bare';
@customElement
class MyElement extends HTMLElement {}
to Glenn for the hyphen idea.
to Duske for delegating this npm package name to me.
FAQs
@customElement decorator
The npm package custom-element-decorator receives a total of 29 weekly downloads. As such, custom-element-decorator popularity was classified as not popular.
We found that custom-element-decorator 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.