谁能帮我理解为什么this.get('property_1')
总是为空?我该如何解决?
App.SomeView = Em.View.extend({ property_1: null, didInsertElement: function() { this.scheduleRefresh(); }, scheduleRefresh: function(){ Ember.run.scheduleOnce('afterRender', this, this.refresh); }.observes('controller.filter_params'), refresh: function(){ if (!this.get('property_1')) { this.set('property_1', 'Hello'); } } });
谢谢!