I am working a project using Psiturk, which uses the jinja2 syntax. I wrote my questionnaire in Angular. I am getting an error when I try to reference $index
in the html directly. The error log shown below shows the issue as the use of $ (dollar sign) in the html. If there a way to make an alias for built in functions in Angular? Thanks
sample code:
<div id="container-exp" ng-app="app" ng-controller="PaginationController">
<fieldset id='top' name='{{page}}' ng-repeat="tweet in pagedData | limitTo:pageSize">
<h3>{{tweet.Tweet}}</h3>
<!--repeates for every item in list-->
<label>sample label 1<input class="radiobttn" ng-model="Responses[tweet.Tw_ID+$index]" id='{{currentPage}}_{{$index}}_1' type='radio' value='1' /></label>
<label>sample label 2<input class="radiobttn" ng-model="Responses[tweet.Tw_ID+$index]" id='{{currentPage}}_{{$index}}_1' type='radio' value='2' /></label>
</<fieldset>
</div>
The error I am getting:
File "/templates/stage.html", line 26, in template
<label>
sample label 1
<input class="radiobttn" ng-model="Responses[tweet.Tw_ID+$index]"
id='{{currentPage}}_{{$index}}_1' name='{{currentPage}}_{{$index}}_21'
type='radio' value='1' />
</label\>
TemplateSyntaxError: unexpected char u'$' at 884