Ngx-admin: @HostListener('window:scroll', ['$event']) not work

Created on 1 Feb 2018  路  2Comments  路  Source: akveo/ngx-admin

Issue type

I'm submitting a ... (check one with "x")

  • [ ] bug report
  • [ *] feature request
  • [ ] question about the decisions made in the repository

Issue description

Current behavior:

i want to do something when the window scroll, add the common code like below ,it not work:

@HostListener('window:scroll', ['$event'])
onWindowScroll(event) {
console.log("scrolling .....");
}

Expected behavior:

Steps to reproduce:

Related code:

  @HostListener('window:scroll', ['$event'])
  onWindowScroll(event) {
  console.log("scrolling .....");
}
needs docs question

Most helpful comment

Hi @zhengmh010, try setting withScroll=''false" for nb-layout as per documentation (https://akveo.github.io/nebular/#/docs/components/layout) to move the scrollbars back to window so that you can listen to that events.

All 2 comments

Hi @zhengmh010, try setting withScroll=''false" for nb-layout as per documentation (https://akveo.github.io/nebular/#/docs/components/layout) to move the scrollbars back to window so that you can listen to that events.

@nnixaa, the @HostListener scroll event isn't firing. The template is something like this:

<div class="container">
  <div class="material-navbar"> ... </div>

  <nb-layout withScroll="false">
    <nb-layout-column> ...rows... </nb-layout-column>
 </nb-layout>

</div>

Is the syntax correct?

There's something called windowMode according to the documentation. Setting windowMode="false" on nb-layout also has no effect.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

queirozfcom picture queirozfcom  路  4Comments

tal-shahar picture tal-shahar  路  3Comments

PatrickHuetter picture PatrickHuetter  路  3Comments

pulfabio picture pulfabio  路  4Comments

xandatspain picture xandatspain  路  3Comments