amitmahida92 / ng4-loading-spinner

Angular 4 custom async loading spinner.
MIT License
69 stars 31 forks source link

Changing loadingText programmatically #42

Closed blu3printchris closed 6 years ago

blu3printchris commented 6 years ago

Can we change the loadingText programmatically per component?

I have tried importing the Ng4LoadingSpinnerComponent and trying spinner.loadingText = "new text" but it just ignores this and uses the text I set in [loadingText]="text" in the HTML.

amitmahida92 commented 6 years ago

@blu3printchris , Yes you can do it.

In app.service you which would be used at app root level, take one service variable to assign that reference to loading text property of spinner component through app.component.ts.

At any point of time where you need to show diff text just plugin app.service there and update variable value used for loading text.

It will show the text you have updated for that component.