title: angular material saving and restoring pageSize into localStorage
body: <p>I would like to save and restore  pageSize into localStorage.
  First, on my mind I I created a directive. It works partially :) I can save pageSize. But How to read it?</p>
  
  <p>Please, mighty All, hint me !</p>
  
  <pre><code>import { Directive, ElementRef, OnDestroy, HostListener, HostBinding } from 
  
  '@angular/core';
  import { UserClientOptionsService } from 'app/user-client-options.service';
  
  @Directive({
    selector: '[itemsPerPage]'
  })
  export class ItemsPerPageDirective implements OnDestroy {
  
    constructor(private element: ElementRef, private optionsService: UserClientOptionsService) {
    }
  
    // it doesn't work. No property pageSize exists
    //@HostBinding('pageSize')
    //pageSize: number;
  
    @HostListener('page', ['$event'])
    onChange(e) {
      this.optionsService.update(x =&gt; x.itemsPerPage = e.pageSize);
    }
  
    ngOnDestroy() {
    }
  }
  </code></pre>
  
  <p>and Html:</p>
  
  <pre><code>&lt;mat-paginator [length]="src" pageSize="10" itemsPerPage [pageSizeOptions]="[5, 10, 20]"&gt;&lt;/mat-paginator&gt;
  </code></pre>