I have the following code:
import { Component } from '@angular/core';
@Component({
selector: 'character',
template: `<h2 class="{{name}}">{{name}}</h2>
<ul>
<li *ngFor="let charStat of charStats">
<p>Abilities = {{charStat.abilities}}</p>
<p>Appearance = {{chatStat.appearance}}</p>
<p>Equipment = {{charStat.equipment}}</p>
<p>Description = {{charStat.description}}</p>
</li>
</ul>`
})
export class CharacterDetailsComponent {
name = 'Mr Character';
charStats = [{
"id": 1,
"abilities": [],
"appearance": [],
"equipment": [],
"description": "I was born in a text village."
}];
}
However, when I try to run it, the template renders as a single bullet-point only and shows the following error in the browser console:
EXCEPTION: Error in ./CharacterDetailsComponent class CharacterDetailsComponent - inline template:4:26
Any ideas how to fix?