Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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 20 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.