Hello,
I have a colorbox dialog and inside it
I have an input ( search bar )
As soon as there is user input in the search bar,
it performs an api call that fetches search results.
These search results are displayed into the colorbox using ng-repeat.
It works fine for the first time but when I execute in the second time ( and on )
I get repeat elements showing inside ng-repeat ( even if I reset the array to 0 )
E.g.
search input: hello world
ng-repeat
hello
hello world
hello world 2
...
but after closing the dialog box and reopening it, I get
hello
hello world
hello world 2
hello
hello
hello
hello world
hello world
hello world
hello world 2
hello world 2
hello world 2
Thanks
PS: As I mentioned earlier I do reset the size of the array back to 0 once the dialog box is closed.
I also watch the size of the array constantly, and in the previous example I get 3 ( not 12 )
Is there sth going on with ng-repeat?
Also, If you have better suggestions on how to write a search input bar, please let me know.