I am trying to convert a number value to a string in angular 2 using typescript within a pipe. It complains
Type string is not assignable to type number
. My pipe is as follows.
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'pxsuffix'
}) export class pxsuffix implements PipeTransform {
transform(input: number): number {
if ((input > 0)) {
input = input.toString(),
}
return (
input = input + 'px',
);
}
}