画面に読み込みバーを表示するサービスがあります。このようにローディングバーを動的に追加します
coreModule.provider('$loading', function () {
this.$get = ['$document', function ($document) {
var element = angular.element('<div id="loading" class="loading">' + '<img src="../styling/img/loading.gif" alt="loading .... ">' + '</div>');
return {
inProgress:function (message) {
$document.find('body').append(element);
},
finish:function () {
// $document.find('body').remove(element); <- does not work
// $document.find('body').remove('#loading'); <- neither this one does !!
}
}
}];
});
ただし、終了機能はまったく機能しません。本体から要素を削除します。何か案は ?