Description
From @Cayan on April 12, 2017 1:21
Did you verify this is a real problem by searching [Stack Overflow]
The closest that I've found is: #612
Tell us about the problem
I have created a repository from scratch to confirm this behavior that I have seen in my project. It is linked in the end.
It basically describes a strange behavior on a project with Angular using ListView with a ChildComponent and the @Input
parameter to send data to it, the methods ngOnInit
, ngOnChanges
and ngAfterViewInit
were used to improve the detection of this behavior.
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 2.5.4
- Cross-platform modules: 2.5.2
- Runtime(s): 2.5.0
- Plugin(s): default ones that come with tns create --ng
Please tell us how to recreate the issue in as much detail as possible.
With just one item in the ListView (the number in front of the events represent the ChildComponent index):
https://gist.github.com/Cayan/3618e8fca3342bf6f8694d215d02bce1
With two items:
https://gist.github.com/Cayan/57f606ab46a2384149f870f0cc4e79bd
With two items, but 500ms delay before adding the second element:
https://gist.github.com/Cayan/2b1480bcaf308eb68b57c90ec08e7258
There are three commits in the repository linked below, each one of them reproduces the above reports.
As you can see there is a really weird behavior going on there with two elements and this grows up with more items (5: https://gist.github.com/Cayan/d6231f2108ac465ab5af8e21fa46598b)
The behavior is the same without the index input.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
https://github.com/Cayan/nativescript-listview-ng-lifecycle
Copied from original issue: NativeScript/NativeScript#3978