Javascript 泳道/ngx用户界面更改按钮';来自警报/提示的标签

Javascript 泳道/ngx用户界面更改按钮';来自警报/提示的标签,javascript,angular,Javascript,Angular,我正在使用泳道的ngx用户界面: 有一个alert/promp/confirm组件,其行为与浏览器的本机组件相同。 问题是,文档中没有说明是否可以从按钮更改标签。 只有一个例子: alertService.confirm({ title: 'Alert SOC', content: 'Intrusion Happened!!!' }) 有人知道这是否可行吗?我不知道警报服务是否可行,但如果使用对话框,它看起来很容易定制 <ng-template #dialogTmpl let-conte

我正在使用泳道的ngx用户界面:

有一个alert/promp/confirm组件,其行为与浏览器的本机组件相同。 问题是,文档中没有说明是否可以从按钮更改标签。 只有一个例子:

alertService.confirm({ title: 'Alert SOC', content: 'Intrusion Happened!!!' })

有人知道这是否可行吗?

我不知道警报服务是否可行,但如果使用对话框,它看起来很容易定制

<ng-template #dialogTmpl let-context="context">
<p>Custom dialog</i></p>
  <button
    type="button"
    class="btn">
    Custom button text
  </button>
</ng-template>
<button
  type="button"
  class="btn"
  (click)="openDialog({ title: 'Alert!', template: dialogTmpl })">
  Open Dialog
</button>

自定义对话框

自定义按钮文本 打开对话框
在.ts中:

import { DialogService } from '@swimlane/ngx-ui';
@Component({
  selector: 'app',
  templateUrl: './app.template.html'
})
export class AppComponent {
  @ViewChild('dialogTmpl') dialogTpl: TemplateRef<any>;
  constructor(public dialogMngr: DialogService) { }
  openDialog(options): void {
    this.dialogMngr.create(options);
  }
}
从'@swimlane/ngx ui'导入{DialogService};
@组成部分({
选择器:“应用程序”,
templateUrl:“./app.template.html”
})
导出类AppComponent{
@ViewChild('dialogTmpl')dialogTpl:TemplateRef;
构造函数(公共dialogMngr:DialogService){}
openDialog(选项):无效{
此对话框mngr.create(选项);
}
}