Closed iBasit closed 8 years ago
There is an "example" folder in the repo. Your setup is not right because you override your "test" variable with vsCollection. You should assign it to a different propery like this: *vsFor="test; #foo = vsCollection ...
and then ngFor="#item of foo"
Kamil Pękala
Dnia 05.05.2016 o godz. 23:51 Basit notifications@github.com napisał(a):
If there was live demo example with code, it would help a lot.
I'm getting error after some rows displayed
Is following setup correct?
inside class constructor
var arr = []; for(var i=1; i<=100; i++) { arr.push(i.toString()); } this.test = arr;
template file
<div *vsFor="test; #test = vsCollection; #_startIndex = vsStartIndex"> <div *ngFor="#item of test; #i = index"> {{ i + _startIndex }} within loop<br/> </div> </div>
the above code does show numbers, but from 1 to 61 (not 100) and throw following error in console log.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
I have used foo
now, but console log error is still same and output also just shows 62 rows from 100
<div *vsFor="test; #foo = vsCollection; #_startIndex = vsStartIndex">
<div *ngFor="#item of foo; #i = index">
{{ i + _startIndex }} - {{ item }}
within loop<br/>
</div>
</div>
Just to keep it in reference.
It is best to follow examples code. as for previous above code, it still gives same error, but implementing example code some how works.
https://github.com/kamilkp/ng2-vs-for/blob/be6f4ab90b0d91ad58a94e646c465be17f751138/example/boot.ts
If there was live demo example with code, it would help a lot.
I'm getting error after some rows displayed
Is following setup correct?
inside class constructor
template file
the above code does show numbers, but from 1 to 61 (not 100) and throw following error in console log.