Updating value later on
fitness23 opened this issue · comments
fitness23 commented
The current system is fine if we know what the initial value is.
However when we get data from an api and wish to update the model's value this doesn't work.
I tried this.codeModel.value = "alert('This is the new code from the api');";
But this doesn't work, the editor still shows the original value. Please could this feature be added?
fitness23 commented
Ah I got it. For anyone stumped with this problem, you need to declare the entire object again. For example after your api has loaded:
this.codeModel = {
language: 'javascript',
value: this.myForm.controls.code['controls'].create.value,
};
Denys Vuika commented
Ok, closing as you have found the solution.