Thursday, October 26, 2017

Angular aot build error–No template specified for component

A colleague sent me the following screenshot with an error he got after switching to an AOT build in Angular:


Here is the related TypeScript file for this component:

The problem was caused by the “template: require('./perceel-list.component.html')” statement in the component file. The aot build doesn’t like it when you try to resolve html templates dynamically.

Removing the require and just using the templateUrl instead solved the problem:


kayal M said...

This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.

Eczema Treatment
Psoriasis Oil
Hyperpigmentation Treatment
Herbal Tonic

malar deepa said...

Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much
Wooden Temple for Home
Tanjore Painting
Pooja Mandir

sunitha vishnu said...

Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
Android Training in Chennai
Ios Training in Chennai