Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了找不到外部模块’angular2 / angular2′ – Angular2 w / Typescript大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在通过关于angular.io的一步一步的教程(角度2).我使用的是typcript.尝试编译时出现以下错误

找不到外部模块’angular2 / angular2′

使用watch命令.

@H_317_1@main.ts

import {Component,View,bootstrap} from 'angular2/angular2';

@Component({
  SELEctor: 'my-app'
})

@View({
  template: '<h1>My first Angular 2 App</h1>'
})

class AppComponent {
}

bootstrap(AppComponent);

的index.html

<!DOCTYPE html>
<html>
  <head>
    <script src="https://jspm.io/system@0.16.js"></script>
    <script src="https://code.angularjs.org/2.0.0-alpha.23/angular2.dev.js"></script>
  </head>
  <body>

    <my-app></my-app>

    <script>
      System.import('main');    
    </script>

  </body>
</html>

Q为什么发生这个错误

将这些@L_801_4@添加到头部将为您提供最新的Angular2版本.
<script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"></script>
<script src="https://jspm.io/system@0.16.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.26/angular2.dev.js"></script>

资料来源:Angular.io: 5 Minute Quickstart

大佬总结

以上是大佬教程为你收集整理的找不到外部模块’angular2 / angular2′ – Angular2 w / Typescript全部内容,希望文章能够帮你解决找不到外部模块’angular2 / angular2′ – Angular2 w / Typescript所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。