Sitelet https://web.archive.org/web/20210111234912/https://github.com/akveo/ngx-admin/issues/5741
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary re renders #5741

Open
noorzaie opened this issue Aug 8, 2020 · 0 comments
Open

Unnecessary re renders #5741

noorzaie opened this issue Aug 8, 2020 · 0 comments

Comments

@noorzaie
Copy link

@noorzaie noorzaie commented Aug 8, 2020

Issue type

  • bug report
  • feature request

Issue description

Current behavior:
Components are re-rendering for unnecessary reasons. For example when I scroll the page, or hover menu items, ... components are re-rendering HTML.

Expected behavior:
Re-render components just when needed.

Steps to reproduce:
Use the following code with ngx-admin starter-kit:

Related code:
dashboard.component.ts:

import {Component} from '@angular/core';

@Component({
  selector: 'ngx-dashboard',
  templateUrl: './dashboard.component.html',
})
export class DashboardComponent {
  constructor() {}

  checkUpdate() {
    console.log('component is re-rendering!!!');
    return 1;
  }
}

dashboard.component.html

<div class="row">
  <nb-card>
    <nb-card-body>Hello from ngx-admin sandbox project.</nb-card-body>
  </nb-card>
  <div style="width: 200px; height: 1000px; background-color: yellow">
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    {{checkUpdate()}}
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
  </div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.