I attempted to insert a new column upon clicking a button, but unfortunately, I was unsuccessful. I have created a JSFiddle demo to illustrate my issue. Any assistance in resolving this problem would be greatly appreciated.
Below is my attempt:
$scope.addValue = function() {
$scope.headers.push('new header');
var users = 5;
for(var i = 0; i < users; i++) {
var rowData = [];
for (var j = 0; j < 1; j++) {
rowData.push('data i=' + i + ' j=' + j)
}
$scope.data.push(rowData);
}
};