I have a config object with a token. Inside, there is a nested headers object that needs to reference the token. I am unable to use this, as shown below (comes up as undefined), and config.token doesn't work either.
var config = {
token: 'abc123',
headers: {
'Authorization': 'bearer ' + this.token
}
}
I need to be able to reassign config.token and have config.headers.Authorization update automatically with the new value.