我从“alertify”包中收到“未定义警报”的错误消息。
这是我的代码的一部分。
提醒服务:
import { Injectable } from '@angular/core';
declare let alertify: any;
@Injectable({
providedIn: 'root'
})
export class AlertifyService {
constructor() {}
confirm(message: string, okCallback: () => any) {
alertify.confirm(message, function(e) {
if (e) {
okCallback();
} else {
}
});
}
success(message: string) {
alertify.success(message);
}
角.json:
注意:我已经在 app module 中添加了 alertify 服务。