I use the ember-cli tool to build an app, but I can’t get my view,here is the code. the controller’s code:
import Ember from 'ember';
export default Ember.Controller.extend({
selfView : null,
toggle : function(){
var selfView = this.selfView;
The problem here, selfView always null, why?
if(selfiew != null){
selfView.splitScreenRefresh();
}
}
});
The view’s code:
import Ember from 'ember';
export default Ember.View.extend({
didInsertElement: function() {
this._super();
this.get('controller').set('selfView', this);
},
splitScreenRefresh : function(){
this.rerender();
}
});