0

I have some delay on image loading time that time I want show a spinner and after image loading time that spinner should hide. What is the correct way to implement this in angular 2 platform.

        <div id='panId' class="container-fluid" >

This is the images loading,

            <img name="imageName1" mouseWheel style.width="{{imgWidth}}" (mouseWheelUp)="mouseWheelUpFunc($event)" (mouseWheelDown)="mouseWheelDownFunc()" 

                *ngIf="showImage" id="mainImage" src="{{imageVisible ? droppedImage: firtsImageToBind}}" class="imagepics mg-image "

                alt="loading..." />


            <img  name="imageName2" id="mainImage" mouseWheel style.width="{{imgWidth}}" (mouseWheelUp)="mouseWheelUpFunc($event)"

                (mouseWheelDown)="mouseWheelDownFunc()" class="mg-image " *ngIf="zoomImageVisible" src="{{zoomedImage}}">
        </div>


</div>
1
  • There are several questions on SO discussing the use of spinners/loading indicators in Angular2 e.g. here. See if those can point you in the right direction Commented Mar 17, 2017 at 6:20

1 Answer 1

1

take a look at PrimeNG they have spinner and it's open source so you can just use it.

http://primefaces.org/primeng

https://github.com/primefaces/primeng

https://github.com/primefaces/primeng/tree/master/components/spinner

Sign up to request clarification or add additional context in comments.

2 Comments

Can I implement any conditional usage for css class loading and hiding that loaded class
Did you try ngClass or ngStyle for this?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.