angular2-pipe

    0热度

    1回答

    我想在Angular 4上用管道排序。管道和ngFor没有问题。 <div *ngFor="let item of data | paginate: { itemsPerPage: 8, currentPage: p } | orderBy : ['{{config}}'] " class="col-lg-3 col-md-6 col-sm-6"> <blog-thumb [date

    2热度

    1回答

    现在我有: <span>{{(price | currency: 'EUR': true)}}</span> 和此输出具有标准格式1,000.00 ,但我需要这种格式1.000,00

    1热度

    1回答

    所以我试图实现的是能够在NgFor上切换多个过滤器,并在每次过滤器打开或关闭时进行更新。 我有这样的管道: import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'filterProducts' }) export class FilterProducts implements PipeTransfo

    3热度

    2回答

    是否可以更改/放置管道来格式化按钮单击Angular 2中的特定列?例如,我有一个带有'姓名'和'小时'列的表格,当我点击一个按钮时,显示'小时'的数据应该转换为天,反之亦然。 <button class="btn btn-secondary" (click)="convertToDays()">Days</button> <button class="btn btn-secondary" (c

    2热度

    1回答

    以下绑定: {{ -50.52338914680037 }} {{ -50.52338914680037 | number }} {{ -50.52338914680037 | percent }} 农产品: -50.52338914680037 -50.523 -5,052.339% 我预计的百分比管道的输出为 -50.523% 有什么我错过了?

    0热度

    1回答

    我已经为表格创建了一个公共搜索管道,我还将列值添加到了选择框中,现在我需要从选择框中获取所选值并在其中访问我管 下面是代码,供大家参考 管 export class searchPipe implements PipeTransform { transform(values: any[], filter: string, selectedvalue:any): any { co

    0热度

    3回答

    我想在angular2应用程序中格式化我的号码。 我想永远是8个数字。 ex。如果我插入: 12345678 -> 12345678 123 -> 0000 123456 -> 0 123456789 ->i'll display a modal error or message(don't care of this) 我搜索,但我发现只有管道,我不能用于这种情况。 thaks

    1热度

    1回答

    我在组件中使用DatePipe将时间戳转换为可读表达式。但是,一旦文件被加载,我得到的例外: 例外:http://localhost:3000/app/interest/user-interest.component.html:15:15错误造成的:表达式检查后发生了变化。以前的值:'6бер。 2017' 年。当前值:'5бер。 2017' 年。 请问谁能解释一下这里发生了什么事。这是基本的代

    0热度

    1回答

    我正在尝试使输入的文本与Regex匹配,然后显示逻辑。如果没有找到,它不应该做任何事情。 因此,Regex应匹配类似(m)或多个:(n) (2) (abc)然后显示逻辑。我们说的“关键词”是: (m) (n) (2) (abc) - 只有这些,不是a-z或A-Z 我到目前为止已经取得了什么: import {Pipe, PipeTransform} from '@angular/core';

    1热度

    1回答

    我似乎无法使Internationalization API的polyfill工作。 如文档规定(https://angular.io/docs/ts/latest/guide/pipes.html) 一个只需要一个脚本添加到您的index.html: <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~lo