前言
小编最近在做ionic项目的时候,在页面上有这么一个功能,要求上传图片,当然文件也行,但是引用了控件之后,发现前端直接就起来不来,错误描述如下
ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'uploader' since it isn't a known property of 'input'. (" <ion-item lines="none"> <input #file type="file" id="file" class="showPicture" ng2FileSelect [ERROR ->][uploader]="uploader" (change)="selectedFileOnChanged(file)"> </ion-item> </ion-list> "): ng:///DailyRecordPageModule/DailyRecordPage.html@42:75 Error: Template parse errors: Can't bind to 'uploader' since it isn't a known property of 'input'. (" <ion-item lines="none"> <input #file type="file" id="file" class="showPicture" ng2FileSelect [ERROR ->][uploader]="uploader" (change)="selectedFileOnChanged(file)"> </ion-item> </ion-list> "): ng:///DailyRecordPageModule/DailyRecordPage.html@42:75 at syntaxError (compiler.js:2427)

本文记录了在使用Ionic进行文件上传时遇到的'ERROR Error: Can't bind to 'uploader'...'问题及解决方案。错误发生在尝试绑定'unloader'属性到input元素时。通过在相关module文件中引入控件并添加引用,成功解决了问题。
最低0.47元/天 解锁文章
840





