Your question can be summarize as "How to use a pipe in a Typescript file". Where your can find the solution here Is it possible to use a pipe in the code?
You need to import the pipe amDateFormat
in the providers
of your module. Then, you need to inject the pipe in the constructor of the component. Finally call the transform function of the pipe.
constructor(
private datePipe: DatePipe
) {
return this.datePipe.transform(user.user_date, "DD/MM/YYYY");
}
You need to change DatePipe
with the name of the pipe you as using. The code works in the last version of Ionic/Angular, not tested in Ionic 1.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…