class ServiceRecordGridFields{
constructor(){
this.allColumns = [
{
field:'assemblynumber',
name:'Assembly',
visible:false,
width:175
},{
field:'assetid',
name:'Asset ID',
visible:false,
width:110
}];
}
getAllColumns(){
return this.allColumns;
}
}
export default ServiceRecordGridFields;
Elsewhere I have
import ServiceRecordGridFields from './_serviceRecordGridFields.js';
class serviceRecordGridsCtrl{
constructor(){
this._ServiceRecordGridFields = ServiceRecordGridFields;
this._serviceRecordsResolve = serviceRecordsResolve;
}
bclick(){
console.log(this._ServiceRecordGridFields.getAllColumns());
}
}
calling the function I get "this._ServiceRecordGridFields.getAllColumns is not a function".
if I add "static" in front of getAllColumns() it returns undefined. What am I doing wrong?
ServceRecordGridFieldswithnew, then callgetAllColumnson that instance.