Uploaded image for project: 'NiFi Registry - MOVED TO NIFI PROJECT'
  1. NiFi Registry - MOVED TO NIFI PROJECT
  2. NIFIREG-277

UI - Allow for consistent angular template/templateUrl inclusion between JS and TS.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.5.0
    • 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

          Activity

            People

              rfellows Rob Fellows
              rfellows Rob Fellows
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h