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 :
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 { …
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…
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:
Mohammed Ajmal
  • 570
  • 1
  • 7
  • 20
0
votes
1 answer

Angular pipe not getting applied inside foreach loop

I am trying to use a pipe inside a foreach loop in my angular component. My array is populated and so is each item of the array when I debug it console.log(this.blog); this.relatedLinks = this.blog.related; …
0
votes
2 answers

Angular, Filter pipe returns empty data/false

i'm trying to follow a custom filter pipe tutorial from this link , but when i run my project on the browser the table become empty. I'm not sure what i have to do to correct this. I already use import import { FilterPipe } from './filter.pipe'; to…
Wira Xie
  • 819
  • 5
  • 24
  • 46
0
votes
1 answer

How to sort version number in Angular 2 custom pipe?

Angular 4 - how to sort version number string in an array using custom pipe? I have a json file with version number like v.9.1, v.9.2, v10.0. I tried sorting using custom pipe but sorted as v.9.2, v.9.1, v.10.0 rather than v.10.0, v.9.2, v.9.1. So…
far007ial
  • 33
  • 4
0
votes
2 answers

use angular 4 Pipe in 2 component

I have component base angular4 app and in every component i'm using DataTable Plugin and custom DataFilterPipe, when i import like below in every component the error i get is ERROR Error: Uncaught (in promise): Error: Type DataFilterPipe is part of…
Mort
  • 1,411
  • 5
  • 19
  • 51
0
votes
3 answers

angular2 pipe Template parse error

i am trying to implement a simple search using pipes. I am really new to the concepts of pipe and angular2, so i need your help here is my html:
Id Description