How do i get Angular to recognise fin

863 Views Asked by At

I'm coding against the openFin fin object but the NG compiler doesn't recognise it. Do I need to import something ? I have @types\openfin in my node_modules.

What else do I need do to use the library ?

Tried importing but can find no examples of what to import

createWindow() {
    const winOption = {
        name:'child',
        defaultWidth: 300,
        defaultHeight: 300,
        url: 'http://localhost:4202/',
        frame: true,
        autoShow: true
    };
    return  fin.desktop.Window.create(winOption);
}

I expect fin to open the running website on 4202 but the output is:

"Cannot read property 'desktop' of undefined"

1

There are 1 best solutions below

0
sacgro On

Yes, install openfin in your angular application with following command:

npm install --save @types\openfin

Once it installed then add following in compilerOptions block in your tsconfig.json

"types":["openfin"]

Now, It will start working..