Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
ngx-mat-msautocomplete
Advanced tools
Angular material Dropdown with multi-select, master toggle and autocomplete filter
Ngx Mat MultiSelect Autocomplete is a simple multiselect dropdown with master toggle and autocomplete filter, designed with angular material. NPMJS: ngx-mat-msautocomplete
The library allows you to:
Add Angular material to your project:
$ ng add @angular/material
Add Angular cdk to your project:
$ ng add @angular/cdk
Install NgxMatMSAutocomplete
$ npm i ngx-mat-msautocomplete --save
Include ngx-mat-msautocomplete in your app.module.ts
...
import { NgxMatMSAutocompleteModule } from 'ngx-mat-msautocomplete';
@NgModule({
declarations: [...],
imports: [
...,
NgxMatMSAutocompleteModule
],
...
})
Add the selector in your component.html file:
<mat-ms-auto [(dropdownList)]="dropdownList" display-key="display"></mat-ms-auto>
Dropdown options - Input array of objects in TS file
fruitsList = [
{
info: 'This is apple',
name: 'Apple'
}, {
info: 'This is orange',
name: 'Orange'
}, {
info: 'This is lemon',
name: 'Lemon'
}, {
info: 'This is gauva',
name: 'Gauva'
}, {
info: 'This is banana',
name: 'Banana'
}, {
info: 'This is kiwi',
name: 'Kiwi'
}
];
Ngx Mat MultiSelect Autocomplete component in HTML file
<mat-ms-auto [(dropdownList)]="fruitsList" display-key="name"></mat-ms-auto>
dropdownList - Required
display-key - Required
Call method on change / selection:
<mat-ms-auto [(dropdownList)]="fruitsList" display-key="name" (selectionChanged)="onChange()"></mat-ms-auto>
Default selection: To select an option by default, add a key => 'selection: true' to the required option in the input array of objects: Example:
fruitsList = [
{
info: 'This is apple',
name: 'Apple',
selection: true
}, {
info: 'This is orange',
name: 'Orange',
selection: false
},
...
];
<mat-ms-auto
name="mat-ms-auto"
placeholder="Types of fruits"
[(dropdownList)]="fruitsList"
display-key="name"
info-key="info"
(selectionChanged)="onChange()"
[masterToggle]="true"
[alignInfoRight]="true"
icon="arrow_drop_down"
hint="List of fruits"
disabled
required></mat-ms-auto>
Attribute | Attribute type | Default value | Description |
---|---|---|---|
placeholder | string | null | Placeholder for the input field |
disabled | boolean | false | Should the input field be disabled |
required | boolean | false | Is the form field required |
masterToggle | boolean | true | Display 'All' checkbox to trigger master selection toggle |
info-key | string | null | Display info values for each dropdown option. Value should be a key in the input array of objects |
alignInfoRight | boolean | false | Align info display to right (true) or left (false) for each dropdown option |
icon | string | "arrow_drop_down" | Icon suffix: Material icon keys |
hint | string | null | Description / hint |
FAQs
Angular material Dropdown with multi-select, master toggle and autocomplete filter
The npm package ngx-mat-msautocomplete receives a total of 0 weekly downloads. As such, ngx-mat-msautocomplete popularity was classified as not popular.
We found that ngx-mat-msautocomplete 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.