Currently, I am utilizing Flask to render an HTML template and wish to transfer the variable add_html_data, which is passed via Flask's render_template, to the scope of an AngularJS controller.
I have attempted the following:
<body>
<div ng-controller="layoutController" ng-init="entries= {{ add_html_metadata|tojson }}"/>
</body>
In this scenario, the {{}} denotes Flask variables (I modified AngularJS binding syntax to {[{}]}).
Additionally, I tried creating an intermediate JavaScript variable:
<script type="text/javascript">var entries = {{ add_html_metadata|tojson }}</script>
Nevertheless, I am still unable to discern how to link it to the controllers scope.
Appreciate any help provided.