Issue
ERROR Error: ngIfElse must be a TemplateRef, but received 'true'
HTML File
<select class="form-control">
<option selected value="0">Select Manufacturer</option>
<option *ngFor="let brand of allMakes">
{{ brand.brand }}
</option>
</select>
ts file
this.allMakes = [{
id: '1',
brand: 'Mazda'
},
{
id: '2',
brand: 'Audi',
}];
It all started right after i upgraded from Angular 5 to Angular 6
Console Log Error
ERROR Error: ngIfElse must be a TemplateRef, but received 'true'.
at Vt (main.6e360f04b7d39ee1dc33.bundle.js:1)
at t.set [as ngIfElse] (main.6e360f04b7d39ee1dc33.bundle.js:1)
at Sa (main.6e360f04b7d39ee1dc33.bundle.js:1)
at main.6e360f04b7d39ee1dc33.bundle.js:1
at main.6e360f04b7d39ee1dc33.bundle.js:1
at es (main.6e360f04b7d39ee1dc33.bundle.js:1)
at Os (main.6e360f04b7d39ee1dc33.bundle.js:1)
at Object.updateDirectives
(main.6e360f04b7d39ee1dc33.bundle.js:1)
at Object.updateDirectives (main.6e360f04b7d39ee1dc33.bundle.js:1)
at ts (main.6e360f04b7d39ee1dc33.bundle.js:1)
Solution
Issues solved, the cause was a redundant property(Bool) that was attached to the "ng-template"
noData: boolean = true;
<ng-template #noData>...Blah blah...</ng-template>
Answered By - Gerald Mathabela
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.