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

Its not working with state provider #54

Open
alimalik91 opened this issue Jan 27, 2016 · 3 comments
Open

Its not working with state provider #54

alimalik91 opened this issue Jan 27, 2016 · 3 comments

Comments

@alimalik91
Copy link

Hi,

I added this in my angularjs app, used in a state.
In the state, provided the css.
But it is loaded in all of the (unrelated) states, instead of just the requisite state.

@scottux
Copy link

scottux commented Feb 9, 2016

Can you provide a code sample of your index.html, app.js, etc.?

@alexcastillo
Copy link
Member

Yes, a plunker would help.

@cwouter
Copy link

cwouter commented Feb 13, 2017

This has probably nothing to do with the issue of alimalik91. But I can confirm that angular-css doesn't work with the latest version of ui-router. (because of the deprecated $stateChangeSuccess event on the $rootScope)

You could workaround this issue by manually broadcasting a rootScope event:

angular
    .module('app')
    .run(['$rootScope', '$transitions', ($rootScope, $transitions) => {
      $transitions.onSuccess({}, transition => {
        // Backwards compatible UI Router
        $rootScope.$broadcast('$stateChangeSuccess', transition.to(), transition.params(), transition.from(), transition.params(), transition.options());
      });
    }]);

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

4 participants