-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Reimplement TabView Lazy Loading #3295
Comments
I'm experiencing the same problem. |
Same problem. Also, according to documentation [lazy] should be on tabPanel, however the property isn't available on this component. |
I'm having the same problem Angular 4.1.1 |
Problem persists: Expectation on this guides a design decision; projected action would be helpful; thanks a bunch. |
As lazy does not work as advertised, had to rewrite it with a pTemplate.
cache property is optional and decides if it should be loaded again when tab gets re-selected. |
is this resolved? |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
http://plnkr.co/edit/C5Al07WC58f0MNNemUBL?p=preview
Current behavior
When lazy prop of TabView is set, all the inactive tabs are initialized regardless (with service call and everything).
Expected behavior
When lazy prop is set to true, it should wait until the user clicks on tab to initialize the related template/component.
Minimal reproduction of the problem with instructions
You can reproduce this bug on following plnkr. Open the console and you'll see following lines
http://plnkr.co/edit/C5Al07WC58f0MNNemUBL?p=preview
Since, I set
[lazy]=true
, it should not initialize second component and log out its messages.On the other hand, if you change the line
<second></second>
to
<second *ngIf="selectedIndex == 1"></second>
in
app.template.html
, it works as expected.However, I should not use
ngIf
if there is a lazy prop of the component.The text was updated successfully, but these errors were encountered: