You need to associate that those properties in model/controller. and reset model properties in model hook and controller properties in setupController accordingly for refresh. Ember will not redraw DOM unless it is in block helper like if
each
with
..
Whole point in Single Page application is replacing values without redrawing/refreshing..That's how we need to design App. IMHO.
But always there is hacky way in ember to make it possible. I would not recommend this.
routes/test.js
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return { name: 'kumkan' };
},
actions: {
clickRefresh() {
this.refresh();
}
}
});
controllers\test.js
import Ember from 'ember';
export default Ember.Controller.extend({
isRefreshed: true,
actions: {
clickRefreshh() {
this.toggleProperty('isRefreshed');
this.send('clickRefresh');
}
}
});
Here comes hacky part,
templates\test.hbs
{{
{{test-comp model=model}}
{{else}}
{{test-comp model=model}}
{{/if}}
<button {{action "clickRefreshh"}}> Refresh </button>
{{outlet}}
templates\components\test-comp.hbs
<input type="text" value="Kumkan" />
{{input value=model.name}}
{{yield}}