<div ng-controller="MyCtrl as my">
<button ng-click="my.pressed = !my.pressed;my.loadData();">
<table ng-show="pressed">
<tr ng-repeat="row in my.data">...</tr>
</table>
</div>
function MyCtrl(dataProvider) {
var self = this;
this.loadData = function () {
if (!self.pressed) return;
dataProvider().then(function(data) {
self.data = data;
});
}
}