It can be overwhelming to try to keep up with all the latest technologies, especially when you're in the middle of a project. Lately, I've been wanting to add a CSS stylesheet to a UI Router state.
I came across this helpful post that addresses exactly what I'm looking for. However, it mentions using Bower, which I've never used before. While I see the benefits of Bower, I'd rather not dive into learning how to install it along with node and npm while working on my current project.
If anyone has any tips on how to incorporate a CSS stylesheet into a UI Router state without relying on Bower or dealing with node and npm, I would greatly appreciate it.
The instructions provided in the post are a bit confusing to me:
Make sure to add uiRouterStyles as a dependency in your application module:
angular.module('myApplication', ['uiRouterStyles'])
Include the relative path to your CSS file(s) in the state data object:
.state('state1', {
url: '/state',
controller: 'StateCtrl',
templateUrl: 'views/my-template.html',
data: {
css: 'styles/some-overrides.css'
}
})
I have some understanding of dependency injection, but I'm not sure how to work with the uiRouterStyles dependency. Is it similar to a service or factory?