typescript - `plnkr` - 导出 typescript `Unexpected token export` 时出现错误 `interface`

标签 typescript angular plunker

我在 http://plnkr.co/edit 中创建了一个 angular2 应用程序。一切正常。我尝试导出一个 interface,但出现错误,如 Uncaught SyntaxError: Unexpected token export - 我不知道这里到底发生了什么错误。

谁能帮我解决这个问题。我提供的路径是 import list-item 的正确路径。

Live Demo

最佳答案

添加

meta: { 'src/list-item.ts': { format: 'es6' }},

到你的 SystemJS 配置

Plunker

也可能与 https://phabricator.babeljs.io/T1151 有关

关于typescript - `plnkr` - 导出 typescript `Unexpected token export` 时出现错误 `interface`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36114770/

相关文章:

Github 页面中的 Angular 路由

javascript - Angularjs:实现与工厂相同的服务结构

javascript - AngularJs - UI 中的字段未反射(reflect)更新的模型值

typescript - 可选字段和联合字段有什么区别?

angular - Angular 2在背景上播放静音的youtube视频

angular - 如何销毁 Angular 组件?

javascript - 为什么我下载这个 Plnkr 后不起作用?

html - 如何在特定索引处的 ngfor 中插入/显示 div

unit-testing - 如何为 Typescript 类型编写负面测试?

typescript 检查对象是否匹配类型