角度2 FlashMessages CSS类不起作用

时间:2018-10-01 07:17:02

标签: angular

我的register.ts

onRegisterSubmit()
  {
    const user ={
      firstname: this.firstname,
      lastname:this.lastname,
      email: this.email,
      password:this.password
    }
    //required fields
    if(!this._validateService.validateRegister(user)){
      this.flashMessage.show('Please fill in all fields',{cssClass:'alert-danger',timeout:3000});
      return false;
    }
}

此flashMessage函数正常运行,但该消息不可见。我认为我在cssClass中犯了错误。我找不到为什么此消息在我的页面中不可见的原因。如果有人知道,请帮助我

1 个答案:

答案 0 :(得分:0)

尝试这种方式-

 this.flashMessage.success('Message', {
        dalay: 2000, <number>
        generalClass: 'success-class', <strigng>
        close: true, <boolean>
        closeBtnClass: 'class1 class2', <string>
        navigate: 'you-url', <string>
 });