I am following this site to integrate office js
On declaring like this:
import * as Excel from '@microsoft/office-js/excel'
It's showing compile time error:
Cannot find module '@microsoft/office-js/excel'
On declaring like this:
declare var Excel: any
It's showing run time error:
ERROR ReferenceError: Excel is not defined
Please suggest how to declare it. I need to use it like this:
Excel.run(session, (context){
...
});
Install office type definition:
In tsconfig.app.json you add:
In main.ts you bootstrap app as:
In index.html you add:
After that you should be able to write something like this in your angular service:
Here you can find a sample of angular office-js project:
Angular office-js sample project
It is Angular 6 build with Angular CLI version 6.0.8