小编Sac*_*hin的帖子

将数据从角度2中的组件传递到自定义管道

如何将数据从组件传递到自定义管道?
我试图将表单数据绑定到组件并传递给管道.

<input [(ngModel)]="phone" placeholder="Phone Number">

想要从组件传递'this.phone'到'PhoneNum'管道.

这是在模板中完成的.
{{phoneNumber | PhoneNum}} // PhoneNum is the pipe

我的问题是在AngularJS中以这种方式从控制器完成的

<input ng-model="phone placeholder="Phone Number">
$filter(‘PhoneNum’)($scope.phone); // something like this.
欣赏时间!

pipe angular

5
推荐指数
2
解决办法
8791
查看次数

标签 统计

angular ×1

pipe ×1