[
https://issues.apache.org/jira/browse/NIFIREG-277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Fellows reassigned NIFIREG-277:
--------------------------------------
Assignee: Robert Fellows
> UI - Allow for consistent angular template/templateUrl inclusion between JS
> and TS.
> -----------------------------------------------------------------------------------
>
> Key: NIFIREG-277
> URL: https://issues.apache.org/jira/browse/NIFIREG-277
> Project: NiFi Registry
> Issue Type: Bug
> Reporter: Robert Fellows
> Assignee: Robert Fellows
> Priority: Major
>
> In the JS files, we can
> {noformat}
> import template from './my-component.html'
> {noformat}
> 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:
> {noformat}
> const template = require('./my-component.html')
> {noformat}
> 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
> {noformat}
> templateUrl: './my-component.html'
> {noformat}
> 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')}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)