Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Break in loop doesn't work

$
0
0

@rafaelmoura wrote:

I am using the Firebase and I have the followig code

  getCustomers() { 
    let array = []; 
    this.service.getItems().subscribe(res => {
      for(let customer of res) {
        if(customer['salesman_id'] == this.salesman_id) {
          array.push(customer);
          console.log(array)
        }  
      }
      this.customers = array
    })
  }

in my console I observable this situation

The loop repeat several times, how to resolve its ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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