0

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>

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.