
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
aurelia-conditionals
Advanced tools
Aurelia framework plugin featuring custom elements for conditional DOM construction.
Currently, Aurelia features a show.bind property that can be added to
HTML elements to conditionally decide whether an element should be
visible. For example, <div show.bind="name === 'admin'></div> would
create a HTML div element that is only visible when the name variable
is equal to "admin".
However, Aurelia does not offer else syntax, meaning you will have to
write two <div> elements, each with their own show.bind properties,
where one negates the expression's result. This causes the expression to
be evaluated twice.
<div show.bind="name === 'admin'">
You are an administrator!
</div>
<div show.bind="name !== 'admin'">
You are not an administrator.
</div>
The aurelia-conditionals plugin solves this problem by providing a
<conditional-if> custom element, which utilises native HTML <slot>
elements to conditionally display data.
<conditional-if expression.bind="name === 'admin'">
<div slot="true">
You are an administrator!
</div>
<div slot="false">
You are not an administrator.
</div>
</conditional-if>
The advantage of the <conditional-if> is that the expression is
evaluated only once, and only needs to be written once.
npm install aurelia-conditionals --save
Then, in src/main#configure(), add the following line:
aurelia.use.plugin("aurelia-conditionals");
If you are using the Aurelia CLI, add the following to
your aurelia_project/aurelia.json dependencies table:
{
"name": "aurelia-conditionals",
"path": "../node_modules/aurelia-conditionals/dist/amd",
"main": "index"
}
npm install
npm test
The project will be built for commonjs and es2015, and amd for
Aurelia CLI project compatibility.
FAQs
Aurelia custom elements for conditional DOM construction
The npm package aurelia-conditionals receives a total of 12 weekly downloads. As such, aurelia-conditionals popularity was classified as not popular.
We found that aurelia-conditionals 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.