angular-loading-bar icon indicating copy to clipboard operation
angular-loading-bar copied to clipboard

How to switch loading bar condition based on views in angular js

Open abhishekbhalani opened this issue 8 years ago • 3 comments

What version of angular-loading-bar are you using? angular-loading-bar v0.9.0

What version of angular are you using? I am using AngularJS v1.5.8

What is the issue ? Right now i have added cfpLoadingBar in my app.config file., it is coming to all the page prior loading. It is ok.

but I want the spinner loading bar to all the page except few other views. I have 4 views used in application.

  1. Home page view
  2. Detail page view
  3. Contact page view
  4. About Us page view

I want spinner loading to contactus & aboutus page. means "cfpLoadingBarProvider.includeSpinner = true;"

and for Home page and details page I want to set template to show the welcome message HTML. means " cfpLoadingBarProvider.spinnerTemplate = "<p>Welcome to my site</p>;" "

How can I handle single angular loading bar with different condition can you help me on this. is there any possibility?

What did you expect to happen?

  1. Home page view - it should come with "welcome message"
  2. Detail page view - it should come with "welcome message"
  3. Contact page view - it should come with spinner as usual
  4. About Us page view - it should come with spinner as usual

If not, then show me different way how to add condition to full fill my query.. What actually happened? Right now, spinner loader coming to all the page views same, I want to differentiate based on views.

abhishekbhalani avatar Oct 26 '16 07:10 abhishekbhalani

Hi,

From what I understand, angular config is setup once during module initialisation. Hence I think you will bot be able to modify or control it's behaviour dynamically.

Regards, Nitin

On Oct 26, 2016 12:39 PM, "Abhi" [email protected] wrote:

What version of angular-loading-bar are you using? angular-loading-bar v0.9.0

What version of angular are you using? I am using AngularJS v1.5.8

What is the issue ? Right now i have added cfpLoadingBar in my app.config file., it is coming to all the page prior loading. It is ok.

but I want the spinner loading bar to all the page except few other views. I have 4 views used in application.

  1. Home page view
  2. Detail page view
  3. Contact page view
  4. About Us page view

I want spinner loading to contactus & aboutus page. means "cfpLoadingBarProvider.includeSpinner = true;" and for Home page and details page I want to set template to show the welcome message template. means " cfpLoadingBarProvider.spinnerTemplate = "Welcome to my site;" "

How can I handle single angular loading bar with different condition can you help me on this. is there any possibility?

What did you expect to happen?

  1. Home page view - it should come with "welcome message"
  2. Detail page view - it should come with "welcome message"
  3. Contact page view - it should come with spinner as usual
  4. About Us page view - it should come with spinner as usual

What actually happened? Right now spinner coming to all the page views

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chieffancypants/angular-loading-bar/issues/333, or mute the thread https://github.com/notifications/unsubscribe-auth/ATeo6ryq61fkPkoVNd78NY_1e1Y3CKnBks5q3vypgaJpZM4Kg1CP .

morpheous27 avatar Oct 27 '16 15:10 morpheous27

@nitinsaxena27 you are right. it doing config time..

How can I do? can you tell me some tips & tricks?

Thank you.

abhishekbhalani avatar Oct 28 '16 10:10 abhishekbhalani

Trick is you can use the same spinner template in your main html file and control it's visibility using Ng if and bind it to a model which is set in the controller. This will mimic the same behaviour. Cheers.

On Oct 28, 2016 3:51 PM, "Abhi" [email protected] wrote:

@nitinsaxena27 https://github.com/nitinsaxena27 you are right. it doing config time..

How can I do? can you tell me some tips & tricks?

Thank you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chieffancypants/angular-loading-bar/issues/333#issuecomment-256887158, or mute the thread https://github.com/notifications/unsubscribe-auth/ATeo6hp0TuO-3pykIdGXubyYj3l-WdjPks5q4cy2gaJpZM4Kg1CP .

morpheous27 avatar Oct 28 '16 10:10 morpheous27