title: Using window.print() in angular 2 print only one page
body: <p>I put the html for print in a <code>div</code> with class <code>forPrint</code> which is in a material dialog page and call the <code>window.print()</code> when the print button is clicked in the angular component.<br>
  However, it shows/prints only the page in the current screen and the rest is cut off when the button is clicked.<br>
  How to print the whole content in the div with class forPrint?<br>
  I think the reason is material dialog because when I print something in a normal page it works fine.</p>
  
  <p>CSS:</p>
  
  <pre><code>@media print {
      /deep/ body * { visibility: hidden; }
      /deep/ .forPrint * { visibility: visible; display:block;}
      /deep/ .forPrint { display:block;position: absolute; top: 40px; left: 30px; } 
  
  }
  </code></pre>