I want to use this library(http://pinesframework.org/pnotify/) on my angularjs project
to show error notifications here is a simple usage for it :
$.pnotify({
title: 'Oh No!',
text: text OR HTML,
type: 'error'
});
What i want is showing the errors i got as JSON on a notification, but i cant add html with angular tags in this notification.
This is what i tried to do (Im calling it from a service and i am passing the $scope to the 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 show [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 angularjs side not by changing the library for my case.
Thanks