Questions tagged [angular-pipe]

Use for discussion of Angular 2+ pipes

An Angular 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 (version 2 and on) introduced a similar concept, now called pipe.

671 questions
0
votes
0 answers

Angular pipe to raw html

Im retrieving from my DB the following string: "P.5 ¿Conoce la OFICINA VIRTUAL de {TOKEN:ATTRIBUTE_50}?" that I need to show as HTML with the strong and u raw labels. Im sure I need to make a Pipe but have no idea how to do…
PriNcee
  • 2,436
  • 3
  • 17
  • 21
0
votes
1 answer

custom pipe array empty

I created this custom pipe: @Pipe({ name: 'orderBy' }) export class OrderByPipe implements PipeTransform { transform(items: any[], orderBy: string): any[] { if (items && items.length > 1) { console.log('items -> ', items); …
Joe
  • 29
  • 5
0
votes
1 answer

Filter search pipe implementation

I'm filtering the items using the pipe to filter My Input filed is in the search.html file and Itemlist in the List.html file Change in the model is not triggering the pipe transform. Please help. Below is the code snippet. Search.html
Sanjaybxl
  • 63
  • 8
0
votes
2 answers

flexible pipe to filter objects

i am trying to make a flexible pipe to filter my array of objects to display it with *ngFor
for example i want to show div only for object with true property…
0
votes
1 answer

The get format statement in angular 2 example

In the angular 2 examples for pipe: https://angular.io/docs/ts/latest/guide/pipes.html there is an example of HeroBirthday2Component. I am not able to understand how this line works get format() { return this.toggle ? 'shortDate' : 'fullDate';…
Pawan
  • 63
  • 6
0
votes
1 answer

Filter pipe throwing errors for table data

I am trying to implement a search pipe for a data set with mixed values of string, number and boolean. I am trying to implement the following pipe Demo, The link works great with a dataset with strings but I keep getting the error that…
Vijay
  • 600
  • 6
  • 16
0
votes
2 answers

how to order items by priority in angular 2?

I'm trying to order meetings by priority [high, medium, low] but I ended up ordering them alphabetically [high, low, medium] , so how to fix this? here's the files: sort.ts import {Pipe, PipeTransform} from…
mg22
  • 245
  • 2
  • 6
  • 13
0
votes
0 answers

Make a custom pipes module

I am in the process of breaking my application into modules but I am having a bit of trouble with pipes, I have a few pipes that I need used across the app. I tried making my own pipes module but that doesn't seem to have worked as I…
Daimz
  • 3,243
  • 14
  • 49
  • 76
0
votes
1 answer

Custom 'moment' pipe bug

I implemented the following custom pipe in my angular 2 app: import { Injectable, Pipe } from '@angular/core'; import * as moment from 'moment'; @Pipe({ name: 'momentPipe' }) @Injectable() export class MomentPipe { transform(value:…
guyaloni
  • 4,972
  • 5
  • 52
  • 92
0
votes
2 answers

Custom angular2 date format pipe that uses translations

first, this is what I would like to accomplish: Let's say I have a model for a posting that contains a js Date object. Now, I would like to render the date in a custom, human readable format that does not show a date and time, but rather an offset…
C. Doe
  • 1,180
  • 8
  • 12
0
votes
1 answer

Generically Binding Values with ngModel

I am just learning Angular 2 and one issue I've been unable to tackle is creating forms with ngModel without statically specifying the name of the attribute I am binding to. I am unsure of the mechanisms for overcoming this problem (though I am…
Jonas Schreiber
  • 447
  • 4
  • 13
0
votes
0 answers

What is the best way to calculate the sum of values in complex table?

I have folowing table: {{data1.name}}
user6408649
  • 1,227
  • 3
  • 16
  • 40
0
votes
1 answer

How to modify pipe to remove duplicate entries?

I have the following JSON File: http://pastebin.com/1TguvZXc The duplicate 'body' can be found in the array by traversing through the array: models[x].years[y].styles[z].submodel.body In other words: …
Moshe
  • 2,583
  • 4
  • 27
  • 70
0
votes
2 answers

Angular2 .filter is not a function

While following a tutorial to filter data using angular2 pipes, got below error EXCEPTION: Error in ./PmProductsComponent class PmProductsComponent - inline template:20:28 caused by: value.filter is not a function Is anyone able to shed some light…
Bromox
  • 567
  • 2
  • 9
  • 29
0
votes
2 answers

ng2-translate directive not working while pipe is

Ng2-translate directive is causing me some issues, but I don't get if I'm doing something wrong or if it's a bug. On the same component's html template, the translate pipe is working, while the translate directive is not. In particular:
don
  • 4,113
  • 13
  • 45
  • 70