The uiState object has get and set methods that you should use to read/write data on it. It will be easier if you also use it as your single source of data:
uiModule.controller('MyController', class {
constructor($scope) {
/* read the rows from the uiState, or return the default (an empty array) */
this.getRows = () => $scope.uiState.get('rows', [])
/* change the rows saved in the uiState */
this.setRows = (newRows) => $scope.uiState.set('rows', newRows)
}
/* add an empty row to the end of the row state */
addEmptyRow() {
this.setRows(this.getRows().concat([]))
}
/* delete the last row in the row state */
removeLastRow() {
this.setRows(this.getRows().slice(0, -1))
}
})
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.