我让Alertify在我的角8项目中工作。现在,我想更改调用alertify.alert时出现的对话框中的标题。文档说,这可以通过使用接受标题:alertify.alert('Title', 'Message')的重载来完成,但是当我尝试使用它时,IDE已经告诉我这是一个无效的参数数,并且在运行时消息框仍然出现,但是标题没有设置。
这是怎么做的?
编辑1
版本:
我是如何整合它的:
在angular.json中
"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中的条目
@import "../node_modules/alertifyjs/build/css/alertify.min.css";
@import "../node_modules/alertifyjs/build/css/themes/bootstrap.min.css";服务:
Import {Injectable} from '@angular/core';
declare let alertify: any;
@Injectable({
providedIn: 'root'
})
export class AlertifyService {
constructor() {
}
error(message: string) {
alertify.alert('MyApp', message);
}
}发布于 2019-10-30 20:59:33
我已经想明白了。问题是脚本条目:
错:
"scripts": [
"node_modules/alertifyjs/build/alertify.min.js"
]正确:
"scripts": [
"./node_modules/alertifyjs/build/alertify.min.js"
]有趣的是,alertify确实用错了台词。
https://stackoverflow.com/questions/58581496
复制相似问题