Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
In the JS files, we can
import template from './my-component.html'
and then reference that template in the component declaration.
However, if you try to do the same thing in a TS file, you get:
"Error: No template specified for component X"
at runtime. This can be solved by using:
const template = require('./my-component.html')
However, this would just be an inconsistency in how we define the components purely based on the file type.
One solution is to standardize on templateUrl in the component declaration
templateUrl: './my-component.html'
And then chain a custom webpack loader for both file types that finds any reference to tempateUrl: './component.html' and converts it at build time to template: require('./component.html')
Attachments
Issue Links
- links to