Ionic2 Ionic 3:未捕获(承诺中):未找到removeView
我正在我的页面上发出警报Ionic2 Ionic 3:未捕获(承诺中):未找到removeView,ionic2,ionic3,Ionic2,Ionic3,我正在我的页面上发出警报 addError(title,message){ const alert = this.alertCtrl.create({ 'title': title, 'subTitle': message, 'buttons': ['OK'] }); alert.present(); } Html代码,内容包括按钮和文本框 <ion-content padding> <ion-l
addError(title,message){
const alert = this.alertCtrl.create({
'title': title,
'subTitle': message,
'buttons': ['OK']
});
alert.present();
}
Html代码,内容包括按钮和文本框
<ion-content padding>
<ion-list>
<ion-item>
<ion-label fixed>Name</ion-label>
<ion-input type="text" [(ngModel)]="name"></ion-input>
</ion-item>
<ion-item>
<ion-label fixed>Secret</ion-label>
<ion-input type="text" [(ngModel)]="secret"></ion-input>
</ion-item>
</ion-list>
<div padding>
<button ion-button color="primary" (click)="add();" block>Add New</button>
</div>
</ion-content>
当我再次调用加法器时,出现以下错误
未捕获(承诺中):未找到removeView问题不是来自
加法器
函数和警报控制器
出现此问题的原因可能是本地存储使用情况this.strorage.addNew({'name':this.name,'secret':this.secret})代码>
此本地存储使用情况必须如下所示
this.storage.addNew( key, value )
this.storage.addNew( 'error', {'name':this.name,'secret':this.secret} )
在您的代码中没有密钥 你把它叫哪里<代码>代码
该用途?点击按钮上的@Sampath您也需要显示html
代码。请同时指定ts文件。@Dr.Geek还添加了ts文件代码。如果您使用正式的爱奥尼亚本地存储,则此用途将与this.storage.set(键、值)相同
strorage:StorageServiceProvider是我的自定义服务,addNew接受类型any。我可以说,您的警报工作正常,因为我尝试了……这个问题与警报组件无关。。。请运行ionic info
并发送邮件,将详细信息添加到您的问题中
this.storage.addNew( key, value )
this.storage.addNew( 'error', {'name':this.name,'secret':this.secret} )