You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tabItems are showed in the wrong order when using *ngIf (angular) #850
Did you verify this is a real problem by searching [Stack Overflow]
yes
Tell us about the problem
tabItems are showed in the wrong order when using *ngIf .
Which platform(s) does your issue occur on?
android, (have not tested on ios yet).
Please provide the following version numbers that your issue occurs with:
nativescript │ 3.0.1 │ 3.0.3 │ Update available │
│ tns-core-modules │ 3.0.1 │ 3.0.1 │ Up to date │
│ tns-android │ 3.0.1 │ 3.0.1 │ Up to date │
│ tns-ios │ │ 3.0.1 │ Not installed
Please tell us how to recreate the issue in as much detail as possible.
-create an app with tabs
-add an *ngif to a tab to be hidden and shown conditionaly.
@Abderrahmane-H by design in Angular you can not have multiple directives athat are going to create template for your component (in the current context - the tabItem)
Not sure about the tabItems, but layout order for *ngIf on/inside ng-container is happening on "@nativescript/angular": "^10.1.3" and "@nativescript/core": "^7.0.3"
Turns out that there was some wrong check that made it so it was impossible to add elements to the start of a view. It seems this has been a bug for at least 3 years, but it's such an edge case that no one had quite picked up on it. I saw it happen once on a test project and didn't think much of it because it didn't work anyway.
Activity
NickIliev commentedon Jun 16, 2017
@Abderrahmane-H by design in Angular you can not have multiple directives athat are going to create template for your component (in the current context - the tabItem)
So if you have
You will receive an error of this sort:
Please send us code snippet or sample project demonstrating exactly how you are reproducing the issue.
NickIliev commentedon Jun 16, 2017
From @Abderrahmane-H on June 15, 2017 14:54
yes I am aware of that, I am using ng-template. here is a code sample
erkanarslan commentedon Aug 18, 2017
Same thing happens when ngIf is used on ng-container component.
8 remaining items
nikoTM commentedon Sep 21, 2020
Not sure about the
tabItems, but layout order for*ngIfon/insideng-containeris happening on"@nativescript/angular": "^10.1.3"and"@nativescript/core": "^7.0.3"edusperoni commentedon Sep 21, 2020
@nikoTM can you provide a sample project (maybe on another issue as well)? Does it also happen on Angular 8 (or 9 without ivy)?
nikoTM commentedon Sep 21, 2020
@edusperoni https://github.com/nikoTM/ivy-ngIf-bug seems to be happening on ivy only for me
edusperoni commentedon Sep 21, 2020
@nikoTM can you check with the latest nativescript-angular release? Should be fixed!
nikoTM commentedon Sep 21, 2020
@edusperoni seems to be happening on
10.1.4, pushed the change.edusperoni commentedon Sep 21, 2020
@nikoTM thanks!
Turns out that there was some wrong check that made it so it was impossible to add elements to the start of a view. It seems this has been a bug for at least 3 years, but it's such an edge case that no one had quite picked up on it. I saw it happen once on a test project and didn't think much of it because it didn't work anyway.
The PR should be up shortly
edusperoni commentedon Sep 21, 2020
@nikoTM PR is up #2262.
This issue (#850) isn't the same as the ng-container issue. It seems tabview just doesn't support inserting elements in the middle of it.
nikoTM commentedon Sep 21, 2020
@edusperoni thanks, that was very quick!