question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue : Angular Material 2 - not rendering in full screen

See original GitHub issue

Bug, feature request, or proposal:

Bug :

I am using Angular Material 2 for my Angular 2 app. My dashboard page is not rendering full page in the browser. Attached is the screenshot of the above mentioned issue.

image

app.component.html

<router-outlet></router-outlet>

dashboard.component.html

<md-sidenav-layout>
  <md-sidenav #sidenav mode="side" class="app-sidenav md-sidenav-over" (open)="list.focus()">
    <ul #list>
      <li> Item 1</li>
      <li> Item 2</li>
      <li> Item 3</li>
    </ul>
  </md-sidenav>

  <md-toolbar color="primary">
    <button class="app-icon-button" (click)="sidenav.toggle()">
      <i class="material-icons app-toolbar-menu">menu</i>
    </button>
    <span class="margin-left10"> Angular Material2 Portal </span>
    <span class="app-toolbar-filler"></span>
    <button md-button router-active [routerLink]=" ['Index']">
      Index
    </button>
    <button md-button router-active [routerLink]=" ['Home']">
      {{ 'HOME.TITLE' | translate }}
    </button>
    <button md-button router-active [routerLink]=" ['About'] ">
      {{ 'ABOUT.TITLE' | translate }}
    </button>
  </md-toolbar>

  <div class="app-content">
    <md-card>
      Dashboard Content Goes Here..!!
    </md-card>
  </div>

  <footer>
    <span id="footerText">Dashboard Footer</span>
  </footer>
</md-sidenav-layout>

dashboard.component.ts

import {Component, Inject, ElementRef, OnInit, AfterViewInit} from '@angular/core';
import {TranslatePipe} from 'ng2-translate/ng2-translate';

console.log('`Dashboard` component loaded asynchronously');

@Component({
  selector: 'dashboard',
  styles: [
    require('./dashboard.component.css')
  ],
  template: require('./dashboard.component.html'),
  pipes: [TranslatePipe]
})
export class Dashboard implements {
  elementRef:ElementRef;

  constructor(@Inject(ElementRef) elementRef:ElementRef) {
    this.elementRef = elementRef;
  }

  ngOnInit() {   
    console.log('hello `Dashboard` component');   
  }

}

Am I missing something here ?

Appreciate your help on this.

What is the expected behavior?

Full screen rendering

What is the current behavior?

Half screen rendering

Which versions of Angular, Material, OS, browsers are affected?

Chrome 51.0.2704.103 m (64-bit) Node 6.x Angular 2.0.0-rc.1 Angular Material 2 - 2.0.0-alpha.5

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
sukhveersinghcommented, Mar 17, 2017

.example-container { position: absolute; min-height: 100% !important;

}

add this class to md-sidenav-container will resolve the issue

1reaction
karacommented, Jul 21, 2016

@happyvig It looks like you’re not using the fullscreen attribute. The sidenav layout isn’t fullscreen by default - you have to add it. Can you try it and report back?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Material 2 - Not rendering in full page - Stack Overflow
I am using Angular Material 2 for my Angular 2 app. My dashboard page is not rendering full page in the browser. Attached...
Read more >
Angular Material 2 - Not rendering in full page-angular.js
You are missing the fullscreen attribute inside of the md-sidenav-layout tag. This attribute will add these properties to the md-sidenav-layout:
Read more >
Menu - Angular Material
By itself, the <mat-menu> element does not render anything. The menu is attached to and opened via application of the matMenuTriggerFor directive:.
Read more >
How to Display Spinner on the Screen till the data from the API ...
How to Display Spinner on the Screen till the data from the API loads using Angular 8 ? · Required Angular App and...
Read more >
Fullscreen toggle functionality in Angular using Directives.
The idea now is to toggle this class when the user wants it to be in fullscreen mode or not. For that, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found