I am trying to run Angular cli generated default app, in Google doc add-on (Google App Script) project, As in google app script only .gs and .html files are allowed i have moved all angular's build JS files in script tags and added them as html. But when i run the add-on i am getting this error
userCodeAppPanel:6862 Uncaught Error: Can't resolve all parameters for ApplicationModule: (?).
at syntaxError (userCodeAppPanel:6862)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getDependenciesMetadata (userCodeAppPanel:22346)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver._getTypeMetadata (userCodeAppPanel:22241)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (userCodeAppPanel:22109)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleSummary (userCodeAppPanel:21920)
at userCodeAppPanel:22033
at Array.forEach (<anonymous>)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (userCodeAppPanel:22021)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleSummary (userCodeAppPanel:21920)
at userCodeAppPanel:22006
Directory structure in google app script project
my modified index.html for app-script
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularAddOn</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<?!= include('runtime.js');?>
<?!= include('vendor.js');?>
<?!= include('styles.js');?>
<?!= include('main.js');?>
<?!= include('polyfills.js');?>
<?!= include('es2015-polyfills.js');?>
<app-root></app-root>
</body>
</html>
And here is my code.gs file
function myFunction() {
}
function onOpen(e) {
DocumentApp.getUi().createAddonMenu()
.addItem('Manage Citations', 'showSidebar')
// .addItem("test dialog", 'showDialog')
.addToUi();
}
function showSidebar() {
var html = HtmlService.createTemplateFromFile('index').evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME).setTitle('wizdom.ai');
DocumentApp.getUi().showSidebar(html);
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename).getContent();
}
Is it impossible to run angular in google add-on? or am i missing something?
i already tried adding following to polyfills.ts but no luck
import 'core-js/es7/reflect';
Thanks
