Hi, I’m new to theia, I want to create a button for open file,but get it “this.FileDialogService is undefined”, this is my code, how can I solve it?
import { FileDialogService } from '@theia/filesystem/lib/browser/file-dialog/file-dialog-service';
@injectable()
export class CustomDialog extends ReactDialog<CreateAPProject> {
@inject(FileDialogService) fileDialogService: FileDialogService;
}
protected async onClick(): Promise<void> {
const uri = await this.fileDialogService.showOpenDialog({
title: 'select File',
canSelectFiles: false,
canSelectFolders: true,
openLabel: 'select',
});
console.log('select', uri);
}
return <div>
<button onClick={() => this.onClick()} >Import</button>
<div>