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
It returns a value as T. so require() returns the type {}.
error TS2345: Argument of type '{ selector: string; template: {}; }' is not assignable to parameter of type 'ComponentMetadataType'.
Types of property 'template' are incompatible.
Type '{}' is not assignable to type 'string'.
idea
Maybe, The loader should replace templateUrl to <string>require(...).
The text was updated successfully, but these errors were encountered:
lacolaco
changed the title
Problem: Cannot use with webpack-env.d.ts
Problem: Cannot use angular2-template-loader with webpack-env.d.ts
Sep 5, 2016
I also feel that replacing stuff with <string>require(...) might interfere with tslint (and tslint-loader) setting of treating such constructs an error. But not sure about this last piece
@TheLarkInn I also think that given the fact that this project's primary consumers are Webpack users, you should really be recommending to install @types/webpack-env
For use webpack APIs (like
require.context()
), webpack-env.d.ts is needed.The definition includes its own
require
.https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/webpack/webpack-env.d.ts#L21
It returns a value as
T
. sorequire()
returns the type{}
.idea
Maybe, The loader should replace
templateUrl
to<string>require(...)
.The text was updated successfully, but these errors were encountered: