You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Robert Fellows (JIRA)" <ji...@apache.org> on 2019/06/04 19:37:00 UTC

[jira] [Created] (NIFIREG-277) UI - Allow for consistent angular template/templateUrl inclusion between JS and TS.

Robert Fellows created NIFIREG-277:
--------------------------------------

             Summary: 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


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)