javascript - How to load System.js modules with TypeScript? - Stack Overflow

I'm trying to get TypeScript working with the default Aurelia skeleton, which is based on System.J

I'm trying to get TypeScript working with the default Aurelia skeleton, which is based on System.JS as a loader.

I'm having trouble getting TypeScript to accept module imports. I renamed one of the skeleton files, "nav-bar.js" to "nav-bar.ts" to see if I could convert the example into TypeScript. The code results in a piler error: "Error:(5, 24) TS2307: Cannot find external module 'aurelia-framework'."

import {bindable} from "aurelia-framework";

export class NavBar {
  //noinspection ES6Validation
  @bindable router = null;
}

How can I get TypeScript to see the aurelia-framework as a valid import? There's a file in the root of the project called config.js that seems to describe the specific location of "aurelia-framework" but TypeScript doesn't know how to load it.

Thanks in advance for your help.

I'm trying to get TypeScript working with the default Aurelia skeleton, which is based on System.JS as a loader.

I'm having trouble getting TypeScript to accept module imports. I renamed one of the skeleton files, "nav-bar.js" to "nav-bar.ts" to see if I could convert the example into TypeScript. The code results in a piler error: "Error:(5, 24) TS2307: Cannot find external module 'aurelia-framework'."

import {bindable} from "aurelia-framework";

export class NavBar {
  //noinspection ES6Validation
  @bindable router = null;
}

How can I get TypeScript to see the aurelia-framework as a valid import? There's a file in the root of the project called config.js that seems to describe the specific location of "aurelia-framework" but TypeScript doesn't know how to load it.

Thanks in advance for your help.

Share Improve this question asked Jun 12, 2015 at 5:04 Greg ShermanGreg Sherman 1,1441 gold badge11 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You may want to use d.ts definition files for registration with TypeScript Definitely Typed registry for use with tsd package manager. You can find different implementations on github, for example here or here. Also this tutorial might be useful.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745306201a4621723.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信