user2066614
user2066614

Reputation: 1

is angularjs supported in google html service?

I have tried to execute this simple code in google apps script that uses angularjs.

Binding is not working. Do I have a mistake or angularJS is not supported in caja?

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script type="text/javascript">

angular.module('App', []);


function HelloCntl($scope) {
  $scope.name = 'World';
}
</script>

<div ng-app="App">
<div ng-controller="HelloCntl">
  Your name: <input type="text" ng-model="name"/>
  <hr/>
  Hello {{name || "World"}}!
</div>
</div>

Upvotes: 0

Views: 492

Answers (2)

jkb016
jkb016

Reputation: 524

You need to include non-minified version of angular js. Google minifies it when generating final html.

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

var ui = HtmlService.createHtmlOutputFromFile('myPage')
  .setTitle('My Title');
ui.setSandboxMode(HtmlService.SandboxMode.IFRAME);

Upvotes: 0

Serge insas
Serge insas

Reputation: 46802

If I refer to this post answered by a Google developer: How can I use Angular.js in a Google Apps Script served HTML site?

It is not.

Upvotes: 1

Related Questions