在下面的示例中,为什么在按下按钮时列表不会变为“更改”?
<ons-page ng-controller="ListController as list">
<ons-button ng-click="list.loaddata()">clickme</ons-button>
<ons-list>
<ons-list-item ons-lazy-repeat="list.delegate">{{ item }}</ons-list-item>
</ons-list>
</ons-page>
和JS:
module.controller('ListController', function () {
this.name = '';
this.loaddata = function () {
this.name = "changed";
};
this.delegate = {
configureItemScope: function (index, itemScope) {
itemScope.item = this.name;
},
countItems: function () {
return 20;
},
calculateItemHeight: function () {
return ons.platform.isAndroid() ? 48 : 44;
}
};
});