angular2-pipe Questions

9

Trying to learn something about filtering and ordering in Angular 2. I can't seem to find any decent resources and I'm stuck at how to order an ngFor output in reverse order using the index. I have...
Kwapong asked 15/11, 2016 at 19:52

7

Solved

I'm making an Angular project where the user has the ability to switch languages. Is it possible to make the locale dynamic? I have seen that you can add it in the NgModule, but I'm guessing it's n...
Redevelop asked 31/5, 2017 at 14:44

8

Solved

I'm trying to create a component where you can pass which pipe that should be used for a list inside the component. From what I could find by testing and looking around for answers the only solutio...
Hanway asked 12/4, 2016 at 6:17

9

Currently I am overriding providers to use mocked services like this: beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { tcb.overrideProviders(AddFieldToObjectDropdownC...
Arroyo asked 2/9, 2016 at 13:9

11

Solved

I can't seem to fix this error. I have a search bar and an ngFor. I am trying to filter the array using a custom pipe like this: import { Pipe, PipeTransform } from '@angular/core'; import { User...
Rasmussen asked 17/8, 2016 at 22:18

11

Solved

The built-in pipe is work,but all custom pipes that i wanna use are the same error: the pipe 'actStatusPipe' could not be found [ERROR ->]{{data.actStatus | actStatusPipe}} I have tried two wa...
Sinful asked 7/11, 2016 at 4:12

6

Solved

I know I can call a pipe like this: {{ myData | date:'fullDate' }} Here the date pipe takes only one argument. What is the syntax to call a pipe with more parameters, from component's template H...
Dorchester asked 23/4, 2016 at 21:41

5

Solved

I have the following template: <div *ngFor="let item of myArray | customPipe1 | customPipe2; let l = length"> Here is the length of my ngFor : {{l}} </div> Unfortunately length does...
Minacious asked 13/6, 2017 at 12:14

2

Solved

During the learning process, I came across Creation of Custom Pipe, so I thought this will help.
Congruent asked 8/1, 2017 at 2:28

3

Solved

I am creating a pipe in angular2 where I want to split the string on white spaces and later on read it as an array. let stringToSplit = "abc def ghi"; StringToSplit.split(" "); console.log(stringT...
Naughton asked 4/7, 2017 at 7:54

5

Solved

I would like to format a date column as a short date in Angular 2 NGX Datatable. Here is the HTML: <ngx-datatable [rows]="toDos" [columns]="columns"> </ngx-datatable> Here is th...
Skipbomb asked 30/3, 2017 at 20:41

5

Solved

@Pipe({name:'myPipe', pure: false}) I am unable to understand impure pipes. What's the difference between pure and impure pipes? Please explain with a simple and basic example.
Organography asked 2/9, 2016 at 6:20

5

Solved

I'm building an application using angular 2 and currency pipe, but I can't find a way to get the currency symbol according to the ISO value without any number. What I mean is that I just want the s...
Luik asked 6/9, 2017 at 14:12

4

Solved

Is it possible in Angular 2 to apply a pipe under condition? I would like to do something like: {{ variable.text | (variable.value ? SomePipe : OtherPipe) }} If not, what is the preferred way t...
Downtrodden asked 29/4, 2016 at 2:13

2

Solved

In Angular 2 I have a component with a template. In the component TypeScript code i create a Reactive Extensions Observable (items$) and use it in an ngFor-directive in the template with an async-...
Lepper asked 12/9, 2017 at 11:56

1

Could somebody explain me conceptual difference between Angular Filters and Angular2 Pipes? They are built for the same purpose, no? Is there any difference under hood? <div>{{user.created |...
Reportorial asked 20/10, 2016 at 7:32

2

Solved

I'm learning Angular2 and I want to format a number adding thousand comma separator. As far as I have read this can be done using Pipes, the thing is that I want to format the number programmatical...
Distrust asked 24/1, 2017 at 22:40

1

I am trying to format the value with percent pipe in html(Angular2) and i need the percentage value without % sign
Fernyak asked 9/1, 2019 at 7:44

3

Solved

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 AppCompon...
Coltun asked 25/8, 2017 at 8:39

5

Solved

I have pure pipe TranslatePipe that translates phrases using LocaleService that has locale$: Observable<string> current locale. I also have ChangeDetectionStrategy.OnPush enabled for all my c...
Mooneye asked 26/1, 2017 at 8:20

2

Solved

I want to write some number into <input> and dynamically display it as a decimal inside {{}} through pipe. It throws exception instead. Here's my code: app.template.html: <h1>amount =...
Precipitate asked 19/7, 2016 at 14:16

1

I have placed my pagination logic in a separate module and importing it in AppModule. Below is my code for my pagination module and AppModule. PagingUtilitiesModule: import { NgModule, ModuleWith...
Personification asked 23/10, 2017 at 6:14

4

Solved

The number format in Swiss German is like "100'000.00" (not "100,000.00"). How can I change that? I tried to change the settings in number_pipe.js from en-US to de-CH without success. var defaultL...
Thicket asked 7/6, 2016 at 16:12

1

Solved

I currently use this pipe {{ product.productPrice | number:'.2-2' }} And result is 1,000,000.00 but I want to remove the .00 How do you do that?
Impercipient asked 30/8, 2017 at 8:5

1

Solved

I have a array of array having two elements each, i.e. arr[a[2]]. Index 0 is name and index 1 is size . I want a pipe to sort the array of array according to size ie index 1 . Example: arr [ [ 'h...
Nonappearance asked 19/7, 2017 at 19:48

© 2022 - 2024 — McMap. All rights reserved.