Questions tagged [angular2-custom-pipes]
31 questions
0
votes
1 answer
How to apply async pipe on observable in ng-container conditionally if some boolean is true in angular
I have an http request that I subscribe to using angular's async pipe. The logic i need is that the async pipe to be added to the ng-container tag only if a certain condition is true. I tried the following code :

Wissam
- 35
- 7
0
votes
1 answer
SortPipe passing parameter
import { Pipe, PipeTransform } from '@angular/core';
import { courses } from '../interface/courses';
@Pipe({
name: 'sort'
})
export class SortPipe implements PipeTransform {
transform(value: Array, args: any[]): Array {
…

M D V Ajay kumar 360
- 27
- 1
- 1
- 5
0
votes
0 answers
Angular Custom Pipe: SafeValue must use [property]=binding
This is my CustomPipe Code:
Here , text is a big chunk of string. And searchColl is the collection of words which needs to be highlighted in it.
This is working well and highlighting all the words in the text, but it appends "SafeValue must use…

rp4361
- 433
- 1
- 5
- 20
0
votes
1 answer
Need to show time in "hh:mm:ss" format in angular 6
We have a response of time in below format like,
"time": "05:36:38.088"
or
"time": "05:36:38+088"
We need to show it in "hh:mm:ss" or "hh:mm".
I tried to convert it by using split and if - else conditions,
But as both format will need diff splits,…

Ni3
- 107
- 1
- 12
0
votes
1 answer
How can I add apply button to filter in angular?
Currently, I have a Gender and Impact filter to the table which is able to filter the data on option selected.
For e.g. If you will select Male it will filter male data and the same for female, impact: applicable and not applicable.
Now, I wanted to…

Kunal Vijan
- 425
- 2
- 9
- 28
0
votes
0 answers
Angular: conditional custom pipe in div ngIf*
Is there a way to conditional process an observable data through a custom pipe in an ngIf
I can do something like
However, I want to have a condition before using customPipe

kaur
- 567
- 1
- 7
- 24
0
votes
1 answer
how to write a custom pipe for filtering the value if length of input text enter is more than 2 charcters
I have this function where I will display array values , if value entered in input box is more than 1 , it will compare and display value. how can i rewrite this in custom filter.
users: searchInputModel[] = [
{
name: 'Jack Daniel',
…

Nicoleta Wilskon
- 687
- 1
- 10
- 32
0
votes
0 answers
Use custom pipe in multiple modules without sharedModule
Is it possible to use CustomPipe in lazy modules without using common or shared modules. I don't want to write pipe for every module.
Below is my CustomPipe.ts
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from…

Ashish Gehlot
- 483
- 8
- 16
0
votes
1 answer
How can i watch value change in angular 4?
I have created custom pipe for my component [grid]. Inside pipe declaration i can take my component instance but at same time i want get if my data-source value changes inside the pipe declaration. Is it possible to get…

Kumaresan Sd
- 1,399
- 4
- 16
- 34
0
votes
1 answer
Angular custom pipes returns error with table data
component.html:
Id | Description |
---|---|