Neden Angular 2, * ngFor? Kullanılarak div bloğu içinde alt görünümler oluşturmama izin vermiyor?Köşeli 2 Şablon ngFor İçinde Kullanılırken Ayrıştırma Hataları
durum:
import {Component, Input} from '@angular/core';
import {ChoiceComponent} from './choice.component';
import {Question} from './model/Question';
@Component({
selector: 'question',
template: `
<div class="panel">
{{question.text}}
<choice *ngFor="let choice of question.choices" [choice]="choice">
</div>
`,
directives: [ChoiceComponent]
})
export class QuestionComponent {
@Input()
question: Question; // Input binding from category component ngFor
}
Ancak şu
EXCEPTION: Template parse errors:
Unexpected closing tag "div" ("
<div class="panel">
<choice *ngFor="let choice of question.choices" [choice]="choice">
[ERROR ->]</div>
"): [email protected]:4
neden çalışıyor, ama aynı panel iç soru seçim düğmeleri sahip olmak istiyorum.
<div class="panel">
{{question.text}}
</div>
<choice *ngFor="let choice of question.choices" [choice]="choice">