I want to use this library ( http://pinesframework.org/pnotify/ ) in my angularjs project
to show error alerts here, simple use for it:
$.pnotify({ title: 'Oh No!', text: text OR HTML, type: 'error' });
I want to show the errors that I received as JSON in the notification, but I cannot add html with angular tags to this notification.
This is what I was trying to do (I am calling it from a service and I am passing $ scope to a function):
scope.errors = {"errors":[{"text":"error1"},{"text":"error2"}]}; var htmlTemplate = '<p ng-repeat = "error in errors.errors">{{error.text}}</p>'; var result = $compile(htmlTemplate)(scope);
Then
$.pnotify({title: title, text: result, type: 'error', });
but the notification just shows [object Object]
if i tried adding it to a div like this it works fine
result.appendTo($("#someDiv"));
I tried to solve it, but nothing worked for me, I want to solve it from the corner, without changing the library for my business.
thank
angularjs compilation templates notifications growl
ibmkhd Dec 25 2018-12-12T00: 00Z
source share