Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
co-selectable-items
Advanced tools
This component can be used when you have a large list of items from which you wish to select a subset to be part of another list.
npm install
npm run build
npm start
serve the fileslocalhost:3000
in web browsernpm test
npm run test-unit
only unit testsnpm run test-e2e
only e2e testsnpm watch
starts the TypeScript compilation watchernpm start
serve the filesA typical situation would be selecting which user roles a specific user should have. Then there is a list of all roles available and a list for each user specifying which roles the user has.
The component is initialised with two lists: selectableItems
, which is the list of all the items available plus a display name, and selectedItems
, which is the selected subset of items.
When selecting and deselecting items, the selectedItems
list is modified.
An example of user roles:
// The original items from the server could look like this:
var originalItems = [
{
role: 'admin'
},
{
role: 'support'
},
{
role: 'basic'
}
]
// In order to use the list of items with this component you
// need to manually transform the list to have a displayName.
// The display name is the string shown to the user
// (especially useful when needing i18n). The actual item is
// stored under the refValue property.
var selectableItems = [
{
refValue: {
role: 'admin'
},
displayName: 'Administrator'
},
{
refValue: {
role: 'support'
},
displayName: 'Customer Support'
},
{
refValue: {
role: 'basic'
},
displayName: 'Basic User'
}
]
// The list of selected items, the roles that the user has.
var selectedItems = [
{
role: 'basic'
},
{
role: 'support'
}
]
Component HTML:
<co-selectable-items
[selectableItems]="selectableItems"
[selectedItems]="selectedItems"
[listHeight]="'150px'"
[selectableHeader]="'Selectable Items'"
[selectedHeader]="'Selected Items'"
(selectedChanged)="someFunction($event)">
</co-selectable-items>
FAQs
Selectable items component for Angular 2
The npm package co-selectable-items receives a total of 51 weekly downloads. As such, co-selectable-items popularity was classified as not popular.
We found that co-selectable-items 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.