Questions tagged search

Explore the latest questions and answers asked by our top developers.

How to hide a component if there is no result found in Angular

In my application page, I have a search bar and imported three components, Attachment, application group and training. If a user search something in search-bar and found the result only in attachments components then how can I hide the other two components?. The problem I have right is now if search result is only found […]

By aaselab
Categorized as angular, filtering, html, search, typescript Tagged , , , ,

Search doesn’t work in list containing image – Angular 12

Html <input matInput (keyup)="applyFilter($any($" placeholder="Search here"> Component applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); console.log(this.dataSource.filter); if (this.dataSource.paginator) { this.dataSource.paginator.firstPage(); } } I cannot find why the same function works in some of my components & doesn’t work properly in the others. The search function is working well in lists having data (without image/file; only text type […]

By Valkyrie 30
Categorized as angular, datasource, image, mat-table, search Tagged , , , ,

How to print search value from a List in Angular

I have a search bar in my home page that filtered out my favorited chards and I’m trying to print the search result numbers but I’m not sure how to print it since my favorites is a List and not array. I have tried {{favorites.length}} then I got this error " Property ‘length’ does not […]

By aase lab
Categorized as angular, filter, html, search, typescript Tagged , , , ,

How to implement filter search in Angular

I’m trying to implement search filter in my Angular project and I did a few googling and found a few implementation and try to copy their solution but I’m not sure why mine is not working so I’ll be really appreciated if somebody can take a look at my code below and in stackblitz. so […]

How to add warning on a combo box selection?

So, I have an existing combo box where a user can type and search for existing options inside the combo box. What I want to do is to add a warning whenever the user type words that does not belong to the options inside the combo box. Here is my code right now: <mat-form-field appearance="outline" […]

angular oracledb search with condititon from form field

i’m developing an angular app that one of the components have search field and i need to get this field to use it in the oracleserver.js that contain connection.execute("SELECT * FROM table where name= the value of search field Source: Angular Questions

By hazagi
Categorized as angular, forms, node-oracledb, node.js, search Tagged , , , ,

Filter JSON Array according to search strings in TypeScript

Given a nested JSON Array I’m trying to implement (so called) frontend side search logic, which to filter data according to the string list. The search condition based on three properties: item name, main category and sub category. Here is the data structure: [ { "id": "id01", "item": { "uniqueId": "d1u2m3m4y5i6d7", "itemName": { "en": "Test […]

By bofanda
Categorized as angular, filter, search, typescript Tagged , , ,

Look for value in a table column that is made up of two database fields

I have a table column composed in Angular in the following way: <tr *ngFor="let activity of"> <td data-cy="employee-cell"> {{ activity.employee.lastName }} {{ activity.employee.firstName }} </td> My research is implemented like this: export function activityEmployeesFilterFn( entities: ActivityEmployee[], { query }: { query: string } ): ActivityEmployee[] { return query ? entities.filter( (e) => -1 < […]

By Man24
Categorized as angular, javascript, search Tagged , ,

Reactive forms-Search pipe issue with Table

I’m facing issue with displaying items returned by search pipe in table . Following is my search pipe code which is returning items. export class NonProdPipe implements PipeTransform { transform(items: any[],filterdata:string):any[]{ if(!items) return []; if(!filterdata) { return items; } filterdata = filterdata.toString().toLowerCase(); return items.filter( it => { return (it.value?.applName.toLowerCase().includes(filterdata) || it.value?.applTerm.toString().toLowerCase().includes(filterdata) || it.value?.applPrice.toString().toLowerCase().includes(filterdata) || ); […]

applying searchPipe in nested element

I have the following pipe which is not working properly in some situation like in below Stackblitz i have added my whole code sample please help me figure out solution. Here Thank you in advance. Source: Angular Questions

By tiana
Categorized as angular, pipe, search Tagged , ,
1 4

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us