Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular component not showing on Internet Explorer 11

I've written an Angular 4 Material 2 app, everything's workin fine in chrome, but on Internet Explorer the page is empty. I've added a <h1> to index.html which shows up, but adding one to my content.component.html does not work, even the code of the whole component is not added to the DOM.

index.html (<h1>Test</h1> shows up in IE):

<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="utf-8">
  <title>ITEM Projekte</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
</head>
<body>
  <h1>Test</h1>
  <app-root></app-root>
</body>
</html>

app.component.html (<h1>Test</h1> does not show up in IE):

<h1>Test</h1>
<md-card>

  <md-card-title>ITEM Projekt anlegen</md-card-title>

  <md-card-subtitle>PROJEKTDATEN</md-card-subtitle>
  <md-card-content>
    <div style="width: 100%; ">
      <md-input-container *ngFor="let item of projektdaten" style="margin-right: 15px; display: inline-block; ">
        <label style="width: 120px; display: block;">{{item.identifier}}:</label><input mdInput name={{item.identifier}} style="width: 150px; " (keyup)="setProjectData(item, $event.target.value)">
      </md-input-container>
    </div>

    <div style="margin-top: 20px;">
      <md-radio-group>
        <md-radio-button value="1" style="margin-right: 30px; ">Neubau</md-radio-button>
        <md-radio-button value="2">Umbau</md-radio-button>
      </md-radio-group>
    </div>

  </md-card-content>

  <md-card-subtitle>MATERIALKOSTEN</md-card-subtitle>
  <md-card-content>
    <md-input-container><label>Test</label><input mdInput></md-input-container>
  </md-card-content>

  <md-card-subtitle>PERSONALKOSTEN</md-card-subtitle>
  <md-card-content>

  </md-card-content>

</md-card>

Btw: In Edge everythings also working just fine, but I need it working in IE ... Please let me know if you need any additional code.

Thanks in advance

like image 240
bene-we Avatar asked Mar 14 '26 05:03

bene-we


1 Answers

I've found the solution here.

Just remove comments below this line in polyfills.ts:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
like image 175
bene-we Avatar answered Mar 16 '26 05:03

bene-we



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!