Skip to content

Commit 6e91cfd

Browse files
feat(import): add template import support
1 parent 2442854 commit 6e91cfd

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Diff for: src/app/app.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Component, OnInit, Inject } from 'ng-metadata/core';
22

3+
import * as appTemplate from './app.html';
4+
35
@Component({
46
selector: 'my-app',
57
styles: [ require( './app.scss' ) ],
6-
template: `
7-
<h1>Hello from Pluto!!!</h1>
8-
`
8+
template: appTemplate
99
})
1010
export class AppComponent implements OnInit {
1111

Diff for: src/app/app.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Hello from Pluto!!!</h1>

Diff for: src/globals.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ declare var ENV: string;
66
interface GlobalEnvironment {
77
ENV: typeof ENV
88
}
9+
10+
// wildcard module declarations see https://www.typescriptlang.org/docs/handbook/modules.html#wildcard-module-declarations
11+
// to enable template import
12+
declare module '*.html';

0 commit comments

Comments
 (0)