我在我的 Angular 8 项目中使用了 Alertify。alertify.alert
现在我想更改调用时出现的对话框中的标题。文档说这可以通过使用接受标题的重载来完成:alertify.alert('Title', 'Message')
但是当我尝试使用它时,IDE已经告诉我这是无效的参数数量,并且在运行时消息框仍然出现但标题不是放。
这是怎么做到的?
编辑 1
版本:
- 角度:7.3.8
- 提醒:1.12.0
我如何集成它:
在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);
}
}