How to access a variable defined in a custom script from a cam-script element

Guys please help me out on this one.

I’m working through the documentation on Custom Scripts in Tasklist(1)

But what is not mentioned is how to access $scope.var1 within a <script cam-script type=“text/form-script”> element.

eg console.log($scope.var1);
which returns “undefined”

How can I access var1?

Thanks so much