
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ng-mat-search-bar
Advanced tools
The component creates a search-icon which expands a search-field on click. See the demo for the effect: 
The component creates a search-icon which expands a search-field on click. See the demo for the effect:
Install the dependency via npm:
npm install ng-mat-search-bar --save
or yarn
yarn add ng-mat-search-bar
and import the module into your apps app.module.ts like this:
import { NgMatSearchBarModule } from 'ng-mat-search-bar';
...
@NgModule({
...,
imports: [
...,
NgMatSearchBarModule
],
...
})
Also make sure that in your app.module.ts you import the BrowserAnimationsModule
, otherwise the animations will not work!
You also need to add Material Icons webfont by adding
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
to your index.html.
You can use the component with its selector:
<mat-search-bar></mat-search-bar>
You can subscribe to the different events the component is outputting:
It also offers two public methods to open / close the searchbar:
and a property:
You can use it with ReactiveFormsModule, by passing a FormControl
as input: e.g
...
<mat-search-bar [formControl]="control"></mat-search-bar>
...
and in .ts file:
...@Component({})...
control: FormControl = new FormControl('');
...
You also can use it combined with Angular Materials autocomplete (https://material.angular.io/components/autocomplete/overview). Just use it as described in the Angular docs and use the mat-search-bar
as the input for it.
Also you can check the app.component.html/.ts
for example code: https://github.com/tommueller/ng-mat-search-bar/blob/master/src/app/
Please don't hesitate to file an issue or send in a PR if you have any improvements or found bugs.
FAQs
The component creates a search-icon which expands a search-field on click. See the demo for the effect: 
The npm package ng-mat-search-bar receives a total of 3,769 weekly downloads. As such, ng-mat-search-bar popularity was classified as popular.
We found that ng-mat-search-bar 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.