devyumao/angular2-busy

show indicator inside the element its defined on

Arikael opened this issue · 1 comments

Hi

I just tried angular2-busy and was rather surprised to find out that all components are not created inside the element I define ngBusy on but afterwards which means that I have to wrap my element inside another parent element with position: relative.
So I have to have at least two <div>

Why are the angular2-busy components not rendered inside the element ngBusy is defined on?

ok, after some digging, this seems to be "by (angular) design" as described here
angular/angular#9035
https://stackoverflow.com/questions/38093727/angular2-insert-a-dynamic-component-as-child-of-a-container-in-the-dom

the solution as described by antoines post in the stackoverflow post would be to do the following

<div>
   <ng-template [ngBusy]="busy"></ng-template>
</div>

this works, but angular's naming int this case feels very counter intuitive.
And without deeper knowledge of angular's inner workings the whole process of including a dynamic component feels like that.