I am struggling to create a list of inputs and I can't seem to get ngFor to work properly.
<div *ngFor="let q of questions; let i = index" class="col-3">
<div class="group">
<input [(ngModel)]="q" [class.ng-not-empty]="q.length > 0">
<span class="bar"></span>
<label>Question {{i}}</label>
</div>
</div>
Here are my current set definitions:
questions: string[];
constructor() {
this.questions = ['blah', 'blah', 'blah'];
}
The error message I am receiving is:
ERROR in : Error: Cannot assign to a reference or variable!
I have tried various ways to define the index, such as:
*ngfor="let q of questions | index as i"
*ngfor="let q of questions; index as i"