Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229748

Pipe not found in custom component

$
0
0

I found a workaround, which i don't believe is a proper solution, but serves the purpose..

I my component i import the pipe directly and create a wrapper function which i use in the template:

component:

import { Component } from '@angular/core';
import { Min2duration  } from '../../pipes/dates/min2duration';

@Component({
  templateUrl:  'template.html',

})
export class CustomComponent {
    constructor() {
   ...
  }

  min2duration(val){
    var m2d = new Min2duration();
    return m2d.transform(val)
  }

}

then in the template:

<ion-label range-left>{{ min2duration(timeFilter['range']['lower'])   }}</ion-label>

Viewing all articles
Browse latest Browse all 229748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>