I am using {{each}} to display the tags. I have a function in the router which I call through a button on the page. If from this function I change the title I can see the title change on the page. However if from this function I add a new tag nothing changes on the page.
I therefore was wondering; is {{each}} the right way to display this type of information? or should I use something else? If each is the correct way how to do this then how to refresh the page after changing the model?
changeIt(model){
// Showing model before any changes.
alert("BEFORE: " + JSON.stringify(model));
// This change is shown from view.
Ember.set(model, "title", "NEW HELLO", true)
// This change does not show from view.
let tags = model.tags;
tags.push({value: "three"});
Ember.set(model, "tags", tags, true);
// However here the model shows as changed.
alert("AFTER:" + JSON.stringify(model));
}
“It is important to use the methods in this class to modify arrays so that changes are observable. This allows the binding system in Ember to function correctly.”