TL;DR Namespace CSS to AngularJS component by styleUrl
property using component name.
We need to scope all CSS styles with a class whose name is equals to component name. (Note that component name is camelCase and class name is kebab-case.)
a-foo {
.class { ... }
...
}
const AFooComponent = {
selector: 'aFoo',
styleUrl: './a-foo.css'
template: '...',
};
angular.module('...', [])
.component('aFoo', AFooComponent);