Angular-cli: Not able to load HTML template with "require(" in angular 9. Getting error "[object Module]"

Created on 12 Feb 2020  路  5Comments  路  Source: angular/angular-cli

Not able to load HTML template with "require(" in angular 9. Getting error "[object Module]"

I am trying to get a template with the following code.

require('!!raw-loader!./demos/basic/basic.html')

Most helpful comment

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-cli.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

All 5 comments

Could you please share some code to reproduce it?

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-cli.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

@sacgrover Thank you for the quick response :)

Below is my code with the module.

<pmd-card>
  <pmd-card-body>
    <button class="btn btn-sm pmd-btn-fab btn-light mb-2" type="button" (click)="codeExample.toggle()" pmdRipple>
      <i class="material-icons md-dark pmd-sm">code</i>
    </button>
    <div class="item" pmdCollapse #codeExample="pmd-collapse">
      <pmd-tab-group>
        <pmd-tab label="template" *ngIf="html">
          <pre class="prettyprint linenums lang-html">{{html}}</pre>
        </pmd-tab>
      </pmd-tab-group>
    </div>
    <div class="section bd-example"><ng-content></ng-content></div>
  </pmd-card-body>
</pmd-card>
{
    name: 'Examples',
    anchor: 'examples',
    outlet: ExamplesNoCardComponent,
    content: [
      {
        title: 'Angular Accordion',
        anchor: 'propeller-angular-accordion',
        description: `
          <p>Propeller Accordion consists of Bootstrap 4 HTML structure with Propeller customized tags.</p>
          <p>Add accordion item using <code>&lt;pmd-accordion-item&gt;</code> tag and to add title pass <code>heading</code> attribute in it. Wrap all the accordion items in a <code>&lt;pmd-accordion&gt;</code> tag to achieve the look and feel based on material design standards.</p>
        `,
        component: require('!!raw-loader!./demos/basic/basic'),
        html: require('!!raw-loader!./demos/basic/basic.html'),
      },

@sunil-digicorp Please post it to stack overflow as suggested.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IngvarKofoed picture IngvarKofoed  路  3Comments

sysmat picture sysmat  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

donaldallen picture donaldallen  路  3Comments