The problem exist only on safari.
Line
this.parent = $document.find('body')[0];//this.parent = undefined;
...
this.parent.appendChild(this.progressbarEl[0]);//thows error
throws error:
TypeError: 'undefined' is not an object (evaluating 'this.parent.appendChild')
Can you please replace it lie:
this.parent =$document[0].body;
Example test case:
app.run([
'ngProgressFactory',
'$document',
function (
ngProgressFactory,
$document
) {
if (!$document.find('body')[0]) {
console.error('Erorr');
}
ajaxProgressBar = ngProgressFactory.createInstance();//throws error
......
}
]);