Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ionic 2 searcher with json array

$
0
0

did that work for you? Because for me the indexof throws error.

Edit:
ok for some reason now it doesn't throws an error (I think it was the changes I did to the tconfigjson or maybe is VSCode being crappy) but it doesn't give me do anything to the array. It does inside the method but after the method does its thing I check the array again (from a button with a method with an alert) and it says the array is the same as originally.

Edit:
Got it to work. The html was fine (it is a little different from the example as I used the one they taught at angular.io) but the code is a little bit different.

What I did was the array initializer I put it inside the
if(q.trim()== ' '){
initializeArray();
return;
}

The thing is that everytime I made changes it was initializing the array all the time. So what I did was I only initialized when the ion-searchbar is empty/whitespace/null (call it whatever.)


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>