Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemjs plugin import, typescript says module not found #4069

Closed
ghost opened this issue Jul 29, 2015 · 3 comments
Closed

systemjs plugin import, typescript says module not found #4069

ghost opened this issue Jul 29, 2015 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@ghost
Copy link

ghost commented Jul 29, 2015

typescript doesn't like import somethingHTML from 'components/something/something.html!text';complains it can't find a module.

import 'components/something/something.html!text';
would work but not usable since I can't assign it to the template property of a component in angular.

using
jspm install text=github:systemjs/plugin-text

What's odd is importing css via the systemjs loader works fine...

@kitsonk
Copy link
Contributor

kitsonk commented Jul 29, 2015

I think you will need to declare an ambient module, something like this I think:

declare module 'components/something/something.html!text' {
    var text: string;
    export = text;
}

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Jul 30, 2015
@ghost
Copy link
Author

ghost commented Jul 31, 2015

@kitsonk that works but that means I will need to do that for every template file.

This might be an issue @guybedford can solve in the plugin.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 31, 2015

This is not something that systemJs or an extension can solve for you. There is a suggestion for the issue in #2709.

@mhegazy mhegazy closed this as completed Aug 10, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

2 participants