While trying to implement alertifyjs on my project, I've bumped into a weird error message when trying to execute/implement the confirm method: Here's my service implementation:
import { Injectable } from '@angular/core';
declare let alertify: any;
alertify.defaults = {
// notifier defaults
notifier: {
position: 'top-right'
},
};
@Injectable()
export class AlertifyService {
constructor() { }
confirm(message: string, okCallback: () => any) {
alertify.confirm(message, function(e) {
if (e) {
okCallback();
}
});
}
success(message: string) {
alertify.success(message, 3);
}
}
When I call the successfull, error or warning methods, it works perfectly, but when trying to call the confirm one, it breaks the application:
hello() {
this.alertify.confirm('Anyone there ?', () => {console.log('hey there ...'); });
}
Using alertifyjs version 1.11.1 ... thanks.