Closed estankovic closed 7 years ago
I duplicated this same issue using Angular 1.6.1 and jQuery 3.1.1. I was also able to duplicate without the newer version of jQuery and just using Angular's jqlite. I was able to make custom templates only work when defined they are defined in a script tag, which is why the tests may have passed (haven't been able to get them working locally yet). If they require an http request then this error will be displayed because the template isn't being extracted from the response. I submitted a fix https://github.com/alexcrack/angular-ui-notification/pull/117
Before: https://plnkr.co/edit/aIKViGiCZUul4wVqd5Vn
$http.get(args.template,{cache: true})
.then(processNotificationTemplate)
.catch(function(data){
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
});
After: https://plnkr.co/edit/3iPnF3X4IvE5lfqtuXlO
$http.get(args.template,{cache: true})
.then(function(response){
processNotificationTemplate(response.data);
})
.catch(function(data){
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
});
I would also like to update the tests with your help @alexcrack :)
Any update on this? We can't use the script tag in our solution
fixed in 043795ea772740e5a853c3ff54657c1bb2fb8a28
This error doesn't seem to be fixed while installing the library through npm, in the source code I still see the previous invalid lines:
$http.get(args.template,{cache: true})
.then(processNotificationTemplate)
.catch(function(data){
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
});
The npm page says that it has an actual version 0.3.5, but downloads a wrong packet.
Yes. Package on npm will be updated soon.
Please update on Bower too, still the same problem
Updated
Hi, I am having an issue with custom templates. If custom template is inlined in anz of views it works ok. Problem is when I try to load template from url. Url is working, in console I get file with 200 header and propper content, but this error appears:
code used to load notofication:
any advice will be appreciated