These are chat archives for angular/material

Jul 2018
Neil Stevens
Jul 16 2018 12:50
Anyone able to answer a question please?
I want to know if it is possible to pass data to a mat-drawer with a component as its content, I know I could set a variable on the parent component when the user clicks open and have that bound to the mat-drawer component but that seems like a hack so I wondered if there was a better way to do this (similar i guess to how the mat-dialog does it)
Jul 16 2018 16:20

can anyone help me to listen scroll event on mat-autocomplete overlay box

Template code

<input matInput placeholder="Notebook Page" formControlName="notebookPage" [matAutocomplete]="NBPageAutocomplete" >
<mat-autocomplete  #NBPageAutocomplete="matAutocomplete" cdkScrollable >
  <mat-option  *ngFor="let option of suggestedNBPageNames" [value]="option">
                {{ option }}

component code

import { ScrollDispatcher } from '@angular/cdk/overlay';

constructor(public scroll: ScrollDispatcher) {}
ngAfterViewInit() {
    this.scroll.scrolled().subscribe((data: CdkScrollable) => {
      //make an HTTP call when it reaches to the end, to add some more data