ngx-mat-query-search
v0.6.0
Published
[Demo](https://128keaton.github.io/NgxMaterialQuerySearch/)
Downloads
18
Readme
NgxMaterialQuerySearch
Usage
- Import the module:
imports: [
QuerySearchModule.forRoot({
loggingCallback: (...args) => {
console.log(...args);
},
debug: true,
encode: false
}),
]
- Use in a component template:
<ngx-query-search>
<query-fields>
<query-field name="name" label="Full Name" type="string"></query-field>
<query-field name="hasValues" label="Has Values" type="string" [values]="['a', 'b']"></query-field>
<query-field name="birthday" label="Birthday" type="date" format="dd/MM/yyyy"></query-field>
<query-field name="joinDay" label="Join Date" type="date" format="MM/dd"></query-field>
</query-fields>
</ngx-query-search>
- Use the service to consume the output:
constructor(private querySearchService: QuerySearchService) {
this.querySearchService.queryUpdated.subscribe(newQueryObject => this.queryObject = newQueryObject);
this.querySearchService.queryStringUpdated.subscribe(newQueryString => this.queryString = newQueryString);
}