Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Angular.js in a Google Apps Script served HTML site?

Is it possible to include and use Angular.js as part of a web app served using HtmlService in Google Apps Script or will caja sanitise it out?

Additionally will it be possible to use Angular within the HtmlService templating method within Apps Script itself?

like image 765
JSDBroughton Avatar asked Oct 04 '12 22:10

JSDBroughton


People also ask

Can you use angular with HTML?

AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly.

Can I use JavaScript in Google App script?

Google Apps Script is a rapid application development platform that makes it fast and easy to create business applications that integrate with Google Workspace. You write code in modern JavaScript and have access to built-in libraries for favorite Google Workspace applications like Gmail, Calendar, Drive, and more.

Can I use angular with JavaScript?

Yes. Angular does use . ts files by default. But if you write simple javascript code in them it will still work.

How do I run a Google script in HTML?

To add an HTML file to your Apps Script project, open the Script Editor and choose File > New > HTML File. Within the HTML file, you can write most standard HTML, CSS, and client-side JavaScript. The page will be served as HTML5, although some advanced features of HTML5 are not available, as explained in Restrictions.


1 Answers

You can use angular with following change in your appscript file.

var ui = HtmlService.createHtmlOutputFromFile('myPage')
  .setTitle('My Title');
ui.setSandboxMode(HtmlService.SandboxMode.IFRAME);
like image 153
jkb016 Avatar answered Oct 16 '22 18:10

jkb016