docs: correct types in transform method to match specification. (#29812)

PR Close #29812
This commit is contained in:
Piotr Tomiak 2019-04-10 16:39:42 +03:00 committed by Jason Aden
parent 3a8f74e392
commit 0051ddf0f3
1 changed files with 2 additions and 3 deletions

View File

@ -11,8 +11,7 @@ import { Pipe, PipeTransform } from '@angular/core';
*/
@Pipe({name: 'exponentialStrength'})
export class ExponentialStrengthPipe implements PipeTransform {
transform(value: number, exponent: string): number {
let exp = parseFloat(exponent);
return Math.pow(value, isNaN(exp) ? 1 : exp);
transform(value: number, exponent?: number): number {
return Math.pow(value, isNaN(exponent) ? 1 : exponent);
}
}