I have a VueJS instance with some data :
var vm = new Vue({
el: \'#root\',
data: {
id: \'\',
name: {
firstname: \"\",
not same scope for this.name
create_casenr: function(event) {
// update the full name of user
$.ajax({
url: 'http://elk.example.com:9200/users/user/' + this.id
})
.done(function(data) {
console.log(data);
this.name = data._source;
this.name.valueset = true;
console.log(this.name);
}.bind(this))
add a bind(this)