我第一次使用jsFiddle。我不知道如何将所有文件都包含进去。目前在运行小提琴时,它会返回一个404.如何链接我的本地ts文件以使其运行。JSFiddle上的Angular2 - 如何包含.ts文件?
我的小提琴位于here。任何帮助将不胜感激。
<script>document.write('<base href="' + document.location + '" />');</script>
<script>
System.config({
transpiler: 'typescript',
typescriptOptions: { emitDecoratorMetadata: true },
packages: {'app': {defaultExtension: 'ts'}}
});
System.import('app/main')
.then(null, console.error.bind(console));
</script>
这将返回:
angular2-polyfills.js:1243 Error: XHR error (404 NOT FOUND) loading https://fiddle.jshell.net/Unnati/kje2sr61/show/app/main.ts (…)
你会考虑使用plunker吗? – echonax
是的,它也可以。 – Unnati
我在下面提供了一个例子。它是否适合您的需求? – echonax