无法读取angular2 es5中未定义的属性“BrowserModule”

时间:2017-02-07 10:24:44

标签: javascript angular

我正在使用 angular2 es5 ,我收到此错误。

  

无法读取未定义的属性“BrowserModule”。

我的服务器端是php with laravel 5.3

这是我的HTML:

<!DOCTYPE html>
<html>
<head>
<title>CRM TEST WITH ANGULAR 2 ES5</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">  
<link rel="stylesheet" href="angular2app/css/styles.css">
<!-- 1. Load libraries -->
<!-- IE required polyfill -->
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.umd.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js">     </script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-all.umd.dev.js"></script>

<!-- 2. Load our 'modules' -->
<script src='angular2app/js/app/app.js'></script>
<script src='angular2app/js/app/app.module.js'></script>
<script src='angular2app/js/main.js'></script>
</head>

<!-- 3. Display the application -->
 <body>
<my-app>
   Loading ...
</my-app>

我的app.module.js是:

(function(app) {
app.AppModule =
ng.core.NgModule({
  imports: [
    ng.platformBrowser.BrowserModule,
    ng.forms.FormsModule
  ],
  declarations: [
    app.AppComponent,
    app.LoginFormComponent
  ],
  bootstrap: [ app.AppComponent ]
})
.Class({
  constructor: function() {}
});
})(window.app || (window.app = {}));

有什么想法吗?

0 个答案:

没有答案