[Vuejs]-Getting typerror in Vue JS while trying to bind the JSON data in select model

0👍

You can use arrow function to fix problem.

        methods:{
        getGroups(){
            axios.get('/api/group/get/all')
                .then(response => {
                    console.log(response);
                    this.groups = response.data;
                    //console.log(groups);
                })
                .catch(error => {
                    console.log(error);
                })
                .then(() => {
                    // always executed
                });
        }
    }

Leave a comment