Thu Aug 01 2019, 3 minutes read
When you are building your AngularDart web application, you may have noticed that you are required to import a generated template file. Which for a component named my_component.dart a corresponding file named my_component.template.dart will also be generated.
When you need to use certain components or code from a file like my_component.dart, often times, you would be asked to import the my_component.template.dart file instead. This is because your component is only ready for import after the DDC (DartDevC, the AngularDart to JavaScript transpiler) has transpiled (transpilation is just like compilation but instead of compiling to machine code, it compiles to another language like JavaScript for example) it, into the template file.
On Component.template.dart files:
To go into more details, click this link to read the full issue!
The Angular compiler generates component factories behind the scenes when you build the app. To access the factory you need to import the generated component template file. Until you’ve built the app, the generated files don’t exist. Use the thing in the link to disable the errors to calm your linters and static analyzers down!
Thanks for reading the articles from this series on AngularDart again! Hope you found this useful/helpful and saved you from pulling out all your hair!