Cam-script in an ng-include does not execute

Hello everyone

I’m trying to include a .html file into an embedded form using ng-include. It all works fine except for cam-script tags.

My form

<!DOCTYPE html>
<form>
	<div ng-include="'Test-Include.html'"></div>
	<script>
		alert("parent-script");
	</script>
	<script cam-script type="text/form-script">
		alert("parent-cam-script");
	</script>
</form>

and the include : Test-Include.html

<script>
	alert("include-script");
</script>
<script cam-script type="text/form-script">
	alert("include-cam-script");
</script>

The alert(“include-cam-script”); statement never executes. What am I doing wrong? Or how can I include cam-script content?

Thanks for any help

I am also facing the same issue. Does anyone has any idea , how to solve this?

I have also faced same issue, Where i had to bind the value of header fields but since camunda scope is not available inside included html it is not by default managed.
Alternative approach is to create javascript function in included html with camForm as an parameter and call this function from script where html was included and pass the camForm as an argument.

Example:

myForm.html

<script cam-script type="text/form-script">
	alert("parent-cam-script");
	includeFunction(camForm);
</script>

and the include: header-include.html

<script>
	includeFunction = function(camForm) {
  camForm.on('form-loaded', function() { 
          // mention your logic here
    } );
}	</script>