首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >转角对话框标题

转角对话框标题
EN

Stack Overflow用户
提问于 2019-10-27 16:58:45
回答 1查看 788关注 0票数 2

我让Alertify在我的角8项目中工作。现在,我想更改调用alertify.alert时出现的对话框中的标题。文档说,这可以通过使用接受标题:alertify.alert('Title', 'Message')的重载来完成,但是当我尝试使用它时,IDE已经告诉我这是一个无效的参数数,并且在运行时消息框仍然出现,但是标题没有设置。

这是怎么做的?

编辑1

版本:

  • 角: 7.3.8
  • Alertifyjs: 1.12.0

我是如何整合它的:

angular.json

代码语言:javascript
复制
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"src/styles.css"
],
"scripts": [
"node_modules/alertifyjs/build/alertify.min.js"
]

styles.css中的条目

代码语言:javascript
复制
@import "../node_modules/alertifyjs/build/css/alertify.min.css";
@import "../node_modules/alertifyjs/build/css/themes/bootstrap.min.css";

服务:

代码语言:javascript
复制
Import {Injectable} from '@angular/core';

declare let alertify: any;

@Injectable({
  providedIn: 'root'
})

export class AlertifyService {

  constructor() {
  }

  error(message: string) {
    alertify.alert('MyApp', message);
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-30 20:59:33

我已经想明白了。问题是脚本条目:

错:

代码语言:javascript
复制
"scripts": [
  "node_modules/alertifyjs/build/alertify.min.js"
]

正确:

代码语言:javascript
复制
"scripts": [
  "./node_modules/alertifyjs/build/alertify.min.js"
]

有趣的是,alertify确实用错了台词。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58581496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档