I am using flask to render an html template. I would like to pass variable add_html_data, that I pass through flask's render_template, to an AngularJs controllers scope.
I tried
<body>
<div ng-controller="layoutController" ng-init="entries= {{ add_html_metadata|tojson }}"/>
</body>
In this case {{}} represent flask variables (I changed angularjs binding syntax to {[{}]}).
Also, I tried creating an intermediary javascript variable
<script type="text/javascript">var entries = {{ add_html_metadata|tojson }}</script>
But, still cannot figure out how to attach it to the controllers scope.
Thanks for any assistance
entries. Since global variables are available anywhere in js code.... inside an angular controller or directive or service$scope.entries=entries.