I am going through the tutorial "Working with a Data Table" https://www.alfresco.com/abn/adf/docs/tutorials/working-with-data-table/
When I am trying to run the code in "Playing with the data source" section, I get a error said
" ERROR in app/src/app/mydatatable/mydatatable.component.ts:17:35 - error TS2339: Property 'webScript' does not exist on type 'AlfrescoApi'.
17 this.apiService.getInstance().webScript.executeWebScript( "
How to fix it? or any materials I should read?
My mydatatable.component.ts code:
import { Component, OnInit } from '@angular/core'; import { AlfrescoApiService } from '@alfresco/adf-core'; import { ObjectDataTableAdapter, ObjectDataRow } from '@alfresco/adf-core'; @Component({ selector: 'aca-mydatatable', templateUrl: './mydatatable.component.html', styleUrls: ['./mydatatable.component.scss'] export class MydatatableComponent implements OnInit { data = new ObjectDataTableAdapter([],[]); constructor(private apiService: AlfrescoApiService) { this.apiService.getInstance().webScript.executeWebScript( 'GET', 'people', null, 'api/-default-/public/alfresco/versions/1', ).then( (response: any) => { let results = []; for (var entry of response.list.entries) { results.push({ id: entry.entry.id, firstName: entry.entry.firstName, lastName: entry.entry.lastName, status: 'green', icon: 'material-icons://accessibility' this.data.setRows(results.map(item => { return new ObjectDataRow(item); })); ngOnInit(): void { onRowClick(event: any) { alert('We just clicked row id: ' + event.value.obj.id); }
Thanks.
look at these links:
https://www.alfresco.com/abn/adf/docs/core/services/ecm-user.service/#
https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/services/ecm-user.service....
and use it in this way:
Discussions, help and advice about the Alfresco Development Framework.