Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
ng2-material-select
Advanced tools
A component inspired by material design for creating visually nice select components.
This is still WIP
Checkout a live demo at http://www.webpackbin.com/4kAEf9Sub
npm install ng2-material-select --save
placeholder
- defines the placeholder when no items are selectedmultiple
- defines whether it's possible to select multiple items// template.html
<ng2-select [placeholder]="'Choose your framework'"
[options]="options"
[(ngModel)]="framework">
</ng2-select>
// app.ts
import { Component } from '@angular/core';
import { Ng2Select } from 'ng2-material-select';
@Component({
selector: 'app',
directives: [ Ng2Select ],
template: require('./home.html')
})
export class App {
framework = 'Angular 2';
options = [
'Angular2',
'React'
];
}
In case you want to use objects instead of simple arrays, you might want to use 2 further options:
displayBy
- defines the key for displaying the value of the item
?identifyBy
- optional, it is useful in case there is the possibility to have items with duplicate values (ex. two items with the same name). In that case, you can defined another key (ex. id) to correctly identify the item. Also, this allows the component to use trackBy
// template.html
<ng2-select [placeholder]="'Choose your framework'"
[displayBy]="name"
[identifyBy]="name"
[options]="options"
[(ngModel)]="framework">
</ng2-select>
// app.ts
import { Component } from '@angular/core';
import { Ng2Select } from 'ng2-material-select';
@Component({
selector: 'app',
directives: [ Ng2Select ],
template: require('./home.html')
})
export class App {
framework = 'Angular 2';
options = [
{
name: 'Angular2',
id: 0
},
{
name: 'React',
id: 1
}
];
}
FAQs
Angular 2 material-like Select Component
The npm package ng2-material-select receives a total of 1 weekly downloads. As such, ng2-material-select popularity was classified as not popular.
We found that ng2-material-select 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.