Questions tagged [angular2-pipe]

An Angular 2 pipe takes in data as input and transforms it to a desired output.

An Angular 2 pipe takes in data as input and transforms it to a desired output.

The first version of AngularJS, used the concept of filters to format the value of an expression for display to the user.

Angular 2 introduced a similar concept, now called pipe.

187 questions
2
votes
1 answer

Angular2 trying to slice string object using SlicePipe in template

Ref : https://angular.io/docs/js/latest/api/common/SlicePipe-class.html. Trying to slice first 20 characters of a string object. Tried :

{{item.description | slice:0:20}}...

and

{{item.description}}[0:20]: '{{item.description |…

Karthigeyan Vellasamy
  • 2,038
  • 6
  • 33
  • 50
2
votes
1 answer

Checkbox filtering only works on refresh Angular2

So for easy usability I want to add checkboxes as filters. However, it only loads when I refresh the page. These are my files: filename.component.ts import { Component } from '@angular/core'; import { CheckboxFilterPipe } from…
Starfish
  • 3,344
  • 1
  • 19
  • 47
1
vote
1 answer

How to bypass debounceTime in angular

I have this text input with a debounceTime pipe, so that we don't hit the server too often while the user is typing the word: this.keyUp$ .pipe(debounceTime(500)) .subscribe(data => this.onInputChanged.emit(data)); However, if the user hits…
Lou
  • 4,244
  • 3
  • 33
  • 72
1
vote
1 answer

Angular V9 Async pipe not updating template view on data change

I'm pretty much a standstill with this now guys. I'm using a small service to get the details from an API, returning a JSON object. I am returning this as an Observable from the service method; then initialising the local component variable…
1
vote
0 answers

Global refresh Angular 2+ app without page refresh

I was wondering if it was possible to perform a global refresh on my Angular (2+) app. I am using the OnPush change detection strategy for performance. I have created a service that translates words from my templates to the browser language of the…
Stan van Heumen
  • 2,236
  • 2
  • 11
  • 20
1
vote
1 answer

angular2 pipe and directive highlightterm is not working in IE11

Hi am try to achieve to filter search term it should be highlight the text so i used first directive and now switched to pipe to test in IE11 browser below is the code.But below code is working in fine in chrome and firefox am not sure why am …
1
vote
1 answer

Angular 4 - How to get a pipe to trigger on a programmatic value change (no keyboard events)

This is my first angualr project. I am updating an inputs value on an elements click. I would like to trigger the filtering pipe when this value is changed. The logic to trigger the pipe is in a directive. Is this possible? Component
Gee_63
  • 76
  • 1
  • 8
1
vote
2 answers

InvalidPipeArgument: '18.06.2009' for pipe 'DatePipe'?

I have this in .ts file : this.newDate = '18.06.2009'; In my html i have this:
{{ newDate | date: 'dd MMMM yyyy'}}
Any suggestion what is wrong with this? How can i fix that so that i get: 1 June 2009
None
  • 8,817
  • 26
  • 96
  • 171
1
vote
3 answers

Register service in root AppModule or root AppComponent

Everywhere, it is recommended to register a service in root AppModule providers array and avoid using providers array of root AppComponent. When should someone register a service in root AppComponent? Any practical example. What is the advantage of…
Jyoti Prasad Pal
  • 1,569
  • 3
  • 26
  • 41
1
vote
3 answers

How to order by closest date to today using Angular2 pipe

Say I have an Event collection: export class Event { startingTime: Date } And I want to display them ordered starting from the closest to TODAY, what would that OrderByUpcomingToLatestPipe look like?
Kesem David
  • 2,135
  • 3
  • 27
  • 46
1
vote
0 answers

Filter table by all match dropdown without interrupt each other

i made two dropdowns with color and width (parameters for filtering) and table that bind data according to choosed parameters, but dropdowns not working together, they interrupt each other: like once it filter by color, then by width, but not by…
1
vote
3 answers

angular 2 - filter pipe return empty

I am trying use filter pipe to filter my data but it returns an empty page. If I remove the | filter on html, there will be data shown. filter pipe works like if the name exist, it will display all the names. First time using filter pipe, please…
user7468826
1
vote
1 answer

Angular2 : The pipe 'SomePipe' could not be found

I have custom pipe which I m using to search a string in the table data and I get the error message "The pipe 'FilterPipe' could not be found" . I referred the below question but the solution given there didn't work me. The pipe ' ' could not be…
user5418103
1
vote
1 answer

How do I make text filter case-insensitive?

My current text filter successfully filters an array and outputs only the exact case match. I want to be able to search without matching the case unaffecting the search results in their respective cases. users = [ {fname: 'John', lname: 'doe'}, …
anonym
  • 4,460
  • 12
  • 45
  • 75