在离子2中将类名添加到div中

时间:2016-08-24 07:10:14

标签: angular ionic2

我使用Alert组件我需要将animated zoomIn之类的类名插入<div class="alert-wrapper"></div>附近的div中

可能吗?enter image description here

doAlert() {
      let alert = Alert.create({
        cssClass: 'animated zoomIn',
        title: 'New Friend!',
        message: 'Your friend, Obi wan Kenobi, just approved your friend request!',
        buttons: ['Ok']
      });
      this.nav.present(alert);
    }

1 个答案:

答案 0 :(得分:0)

如果你想要一些自定义,那么试试这个 只需创建如下警告:

let alertPopup = Alert.create({
title: 'title',
subTitle: 'message',
cssClass: 'animated_zoomIn',
buttons: [{
text: 'btnType',
cssClass: 'buttoncss'
}]
});
this.nav.present(alertPopup);

In your app.core.scss or your page scss, define your cssClass like this:

.buttoncss{
color:#e74c3c;
/*Any other style you wish to apply*/
}

.animated_zoomIn{
color:#e74c3c;
/*Any other style you wish to apply*/
}

----Make sure your page scss is imported----