I use AngularJS + Flask in my application, and I want to know how best to "create" the URL, and don't write any hard code for this. I have this situation:
* given that I use [[]] instead of {{}} for AngularJS.
<dd ng-repeat="item in myList">
<span ng-click="doAction('{{ url_for('my_url', id="[[item.id]]") }}')">
[[item.name]]
</span>
</dd>
This will not work because Jinja2 executes the url_for () process before AngularJS, so "[[item.id]]" will not be replaced with AngularJS in time.
The problem is that I do not want to write in hard code like this:
<span ng-click="doAction('/my_url/[[item.id]]')">
[[item.name]]
</span>
I'm new to AngularJS, maybe all my approaches are wrong, so does anyone know that the best way to get an element to click is to make a request with a URL based on the context of the clicked element