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

ui-route-styles.js does not work when no views are specified #12

Closed
gastaldi opened this issue Apr 15, 2015 · 1 comment
Closed

ui-route-styles.js does not work when no views are specified #12

gastaldi opened this issue Apr 15, 2015 · 1 comment

Comments

@gastaldi
Copy link
Contributor

having the following module:

angular.module('myApp', ['ui.router','routeStyles'])

.config(function($stateProvider, $urlRouterProvider){
  // For any unmatched url, redirect to /
  $urlRouterProvider.otherwise("/");

  // Now set up the states
  $stateProvider
    .state('home', {
      url: "/",
      templateUrl: "views/home.html"
    })
    .state('addons', {
      url: "/addons",
      templateUrl: "views/addons.html",
      css: 'css/forge_addons.css'
    })
    .state('documentation', {
      url: "/documentation",
      templateUrl: "views/documentation.html",
      css: 'css/forge_documentation.css'
    });
});

Whenever a state changes, the CSS is not being applied.

@gastaldi
Copy link
Contributor Author

It looks like it considers only states with the views attribute. As for the example in https://scotch.io/tutorials/angular-routing-using-ui-router, templateUrl should be enough

gastaldi added a commit to gastaldi/angular-route-styles that referenced this issue Apr 16, 2015
This fix allows the usage of the css attribute inside the state instead of expecting it to be declared inside views
@gastaldi gastaldi changed the title ui-route-styles.js does not work ui-route-styles.js does not work when no views are specified Apr 16, 2015
tennisgent added a commit that referenced this issue Aug 14, 2015
Fixes #12: States including css are now used
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

1 participant