管道
- 概述:管道是具有
@Injectable()装饰器的类。管道应实现PipeTransform接口 - 应用场景
- 转换:管道将输入数据转换为所需的数据输出(字符串转数字)。
- 验证:对输入数据进行验证,如果验证失败则抛出异常
内置管道
ValidationPie ParseIntPipe ParseFloatPipe PaseBoolPipe ParseArrayPipe ParseUUIDPipe ParseEnumPipe DefauleValuePipe ParseFilePipe
自定义管道