0

In my vue js application I have this getImportList method:

methods: {
    setIdFeed(id_feed) {
        this.id_feed = id_feed;
    },
    getImportList() {
        http.get("projects/import/" + this.project_token + '/' + this.user_id)
        .then((response) => {
            if( Object.keys(response.data).length !== 0 ) {
                response.data.forEach(function (entry) {
                    this.rows.push({
                        id_feed : entry.id_feed,
                        feed_name: entry.feed_name + " (" + entry.feed_type + ")",
                        tpi: '',
                        status: entry.status,
                    });
                });
            }
        })
        .catch((error) => {
            console.log(error);
        });
    }
},

As you can see I have used this in this method BUT it's not working in the .then method, I can't get the data using this.

Why this this is not available here?

Shibbir
  • 1,963
  • 2
  • 25
  • 48

0 Answers0