File tree Expand file tree Collapse file tree 1 file changed +15
-24
lines changed
Expand file tree Collapse file tree 1 file changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -143,30 +143,21 @@ import { I18n } from "./../i18n/i18n.module";
143143 * }
144144 *
145145 * protected prepareData(data: Array<Array<any>>) {
146- * // create new data from the service data
147- * const newData: Array<Array<TableItem>> = [];
148- * data.forEach(dataRow => {
149- * const row: Array<TableItem> = [];
150- * dataRow.forEach(dataElement => {
151- * let template;
152- * if (dataElement.template) {
153- * template = dataElement.template;
154- * } else if (typeof dataElement === 'string') {
155- * template = undefined;
156- * } else {
157- * template = this.paginationTableItemTemplate;
158- * }
159- *
160- * row.push(
161- * new TableItem({
162- * data: dataElement.data,
163- * template: template
164- * })
165- * );
166- * });
167- * newData.push(row);
168- * });
169- * return newData;
146+ * // create new data from the service data
147+ * let newData = [];
148+ * data.forEach(dataRow => {
149+ * let row = [];
150+ * dataRow.forEach(dataElement => {
151+ * row.push(new TableItem({
152+ * data: dataElement,
153+ * template: typeof dataElement === "string" ? undefined : this.paginationTableItemTemplate
154+ * // your template can handle all the data types so you don't have to conditionally set it
155+ * // you can also set different templates for different columns based on index
156+ * }));
157+ * });
158+ * newData.push(row);
159+ * });
160+ * return newData;
170161 * }
171162 * ```
172163 *
You can’t perform that action at this time.
0 commit comments