You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error:(22, 12) TS2345: Argument of type '{ selector: string; template: {}; directives: Type[][]; }' is not assignable to parameter of type '{ selector?: string; inputs?: string[]; outputs?: string[]; properties?: string[]; events?: strin...'.
Types of property 'template' are incompatible.
Type '{}' is not assignable to type 'string'.
I fix it by using: @component({
selector: 'test',
template: "" + require('./test.component.html') + ""
})
In your project you have home.component.ts configured like this and it works without warning.
How did you solve this issue as it works perfectly without warning in your project?
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
I ran your project and everything works fine. However, when I did a more simplified version of Webpack + Angular2 I got the following problem:
When defining a component with requiring html template like this:
@component({
selector: 'test',
template: require('./test.component.html')
})
I get the following error:
Error:(22, 12) TS2345: Argument of type '{ selector: string; template: {}; directives: Type[][]; }' is not assignable to parameter of type '{ selector?: string; inputs?: string[]; outputs?: string[]; properties?: string[]; events?: strin...'.
Types of property 'template' are incompatible.
Type '{}' is not assignable to type 'string'.
I fix it by using:
@component({
selector: 'test',
template: "" + require('./test.component.html') + ""
})
In your project you have home.component.ts configured like this and it works without warning.
How did you solve this issue as it works perfectly without warning in your project?
Thanks
The text was updated successfully, but these errors were encountered: