加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 如何使用像烤面包机通知这样的ngx-bootstrap创建公共

发布时间:2020-12-17 07:26:50 所属栏目:安全 来源:网络整理
导读:我是角度2的新手. 4.我想用ngx-bootstrap警报和模态创建自定义通知.我搜索了一些样本.但那些并不简单.我只需要一个简单的蓝图来创建服务,接口和组件的通知. 请任何人用示例代码指导我. ngx-bootstrap的官方文档 – Alerts. ngx-bootstrap的官方文档 – Modal
我是角度2&的新手. 4.我想用ngx-bootstrap警报和模态创建自定义通知.我搜索了一些样本.但那些并不简单.我只需要一个简单的蓝图来创建服务,接口和组件的通知.

请任何人用示例代码指导我.

ngx-bootstrap的官方文档 – Alerts.
ngx-bootstrap的官方文档 – Modals.
这里提供的API文档和使用场景以及实际示例.

为了快速参考,我将为您提供一个简单警报框的代码 – 下面的用法和演示:

首先,使用以下方法导入Root模块中的ngx-bootstrap:

import { AlertModule } from 'ngx-bootstrap';

@NgModule({
  imports: [AlertModule.forRoot(),...]
})
export class AppModule(){}

这里是HTML部分模板:

<alert type="success">
  <strong>Well done!</strong> You successfully read this important alert message.
</alert>

组件代码如下:

import { Component } from '@angular/core';

@Component({
  selector: 'demo-alert-basic',templateUrl: './basic.html'
})
export class DemoAlertBasicComponent {}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读