/// /// import { getViewFields, IViewFieldsOption } from '../../../index'; import { parse } from 'query-string'; let appWebUrl: string = parse(location.search).SPAppWebUrl; let options: IViewFieldsOption = { webUrl: appWebUrl, isAppContextSite: false, list: 'TestList', view: 'All Items' }; getViewFields(options, function (viewFields: Array) { let html: string = '

View fields of "All Items" view in TestList:

'; html += '
    '; for (let i: number = 0, length: number = viewFields.length; i < length; i++) { let viewField: SP.Field = viewFields[i]; html += '
  • Field type: ' + viewField.get_typeAsString() + ', field internal name: ' + viewField.get_internalName() + '
  • '; } html += '
'; $('#message').html(html); }, function (message: string) { $('#message').html(message); });