Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic2 Ionic 3:未捕获(承诺中):未找到removeView_Ionic2_Ionic3 - Fatal编程技术网

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} )