-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Open
Labels
area: routerfeatureIssue that requests a new featureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
router
Description
For an Angular UI library like Clarity, regarding the application layout, .content-container
class is required for the top level route components.
I'd like to propose a feature request about binding classes for component activated by router-outlet
.
Proposed solution
Add an @Input() componentClass = ''
to router-outlet
directive.
Aafter this.activated
is initialized, add the classes to the created or attached component as following:
this.activated.location.nativeElement.classList.add(...this.componentClass.split(' '));
Alternatives considered
Currently, as mentioned above, for each route component, the following codes should be added in the @Component
metadata:
host: {
'[class.content-container]': 'true',
},
Adding componentClass
to router-outlet solves it more directly and concisely.
KingMario, Harpush, gwasserfall, Adonsio, craiggoldstone and 2 more
Metadata
Metadata
Assignees
Labels
area: routerfeatureIssue that requests a new featureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors