如何将数据从组件传递到自定义管道?
我试图将表单数据绑定到组件并传递给管道.
<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.
欣赏时间!