Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abhishekbhalani opened this issue Oct 26, 2016 · 3 comments
Open

Comments

@abhishekbhalani
Copy link

abhishekbhalani commented Oct 26, 2016

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.

@morpheous27
Copy link

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" notifications@github.com 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
#333, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATeo6ryq61fkPkoVNd78NY_1e1Y3CKnBks5q3vypgaJpZM4Kg1CP
.

@abhishekbhalani
Copy link
Author

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

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

Thank you.

@morpheous27
Copy link

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" notifications@github.com 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
#333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATeo6hp0TuO-3pykIdGXubyYj3l-WdjPks5q4cy2gaJpZM4Kg1CP
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants