-
Notifications
You must be signed in to change notification settings - Fork 216
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
Hard to make a new component fill the rest of body #266
Comments
This is essentially a css issue, and there are many ways around it. .mat-sidenav,
.mat-drawer-content,
// Force style down to child components
// See https://angular.io/guide/component-styles#deep
:host ::ng-deep .mat-drawer-backdrop {
top: 64px;
bottom: 0;
left: 0;
right: 0;
height: auto;
position: absolute;
}
@media ($mat-xsmall) {
.mat-sidenav,
.mat-drawer-content,
:host ::ng-deep .mat-drawer-backdrop {
top: 56px;
}
} This was a design choice made at a time when the As for the content, having it fill rest of the body is up to your design choice but it is already fixed in the (currently unreleased) next version in the master branch. However, we are not going to change the app architecture regarding the app shell, especially considering that we will rely on it to optimize PWA performance by implementing the new App Shell option available since angular@5.1, see https://blog.angular.io/angular-5-1-more-now-available-27d372f5eb4e |
As a clarification, the |
Thanks for the comments. I will have a look what you suggested. |
The mentioned example above: |
I'm submitting a...
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
Current behavior
Router service is implemented by nesting a new component into the router-outlet part of the ShellComponent. I see the hack scss setting in shell.component.scss just to make the new component not overlapped with the app-header.
This is really hard to make the new component fill the rest area of the body.
Expected behavior
The new component will could fill the rest area of shell component without having to hack around the scss style.
A possible way is to bind the router-outlet as ng-content of ShellComponent in RouterSertice.ts if possible.
If we define ShellComponent as page template by replacing router-outlet with ng-content and wrap every component with app-shell, then it seems to work. You do not need to call RouterService.withShell, and you also have the flexibility to not add auth guard for all the component with shell component.
Yes, then you have to wrap every new component with app-shell which is also not so elegant. Another down-side is also that you can not cache the ShellComponent for each routing.
Minimal reproduction of the problem with instructions
This problem happens in the angular, material-design, flexlayout, webapp.
Environment
I upgrade to the newest version of packages. It behaves the same.
Others:
The text was updated successfully, but these errors were encountered: