Javascript 未捕获类型错误:未定义不是函数&;未捕获范围错误:超过最大调用堆栈大小Angular2

Javascript 未捕获类型错误:未定义不是函数&;未捕获范围错误:超过最大调用堆栈大小Angular2,javascript,angular,Javascript,Angular,为了学习Angular2框架,我一直在使用javascript关注Angular2 quicstart。。我一直在按照指导方针做,但我有一个错误 Uncaught TypeError: undefined is not a function angular2-all.umd.js:3528 Uncaught RangeError: Maximum call stack size exceeded angular2-polyfills.js:143 我不确定我是否遗漏了什么,这是我应用程序的文件

为了学习Angular2框架,我一直在使用javascript关注Angular2 quicstart。。我一直在按照指导方针做,但我有一个错误

Uncaught TypeError: undefined is not a function angular2-all.umd.js:3528
Uncaught RangeError: Maximum call stack size exceeded angular2-polyfills.js:143
我不确定我是否遗漏了什么,这是我应用程序的文件结构

  • 应用程序/
    • app.component.js
    • boot.js
  • 节点单元/
  • index.html
  • package.json
这就是代码库

app.component.js

(function (app) {

    app.AppComponent = ng.core
        .Component({
            selector: 'my-app',
            template: '<h1>My First Angular 2 App</h1>'
        })
        .Class({
            constructor: function () {
            }
        });

})(window.app || (window.app == {}));
index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Angular 2</title>

    <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
    <script src="node_modules/rxjs/bundles/Rx.umd.js"></script>
    <script src="node_modules/angular2/bundles/angular2-all.umd.js"></script>

    <script src="app/app.component.js"></script>
    <script src="app/boot.js"></script>

</head>
<body>
    <my-app>Loading..</my-app>
</body>
</html>

角度2
加载。。

我认为我很好地遵循了快速入门,但我不确定我错过了什么,因为我是Angular2的新手。你的代码中有一个几乎不可察觉的拼写错误,这造成了巨大的差异。这是你在
app.component.js
文件中的生活:

(function (app) {
    // ...
})(window.app || (window.app == {}));
// comparison operator ------^
请注意,当您需要赋值时,请使用比较运算符:

(function (app) {
    // ...
})(window.app || (window.app = {}));

是的,我打错了,谢谢注意!不幸的是,这并没有解决问题。。。我还收到错误信息真的吗?因为我实际上测试了你的代码——这就是我意识到这个打字错误的原因。它确实解决了问题。你能和我分享测试过的代码吗?或者可能是浏览器版本导致了这个问题?你试过了吗?试过了,它返回了未捕获的TypeError:undefined不是一个函数集合。ts:65所以我想我的chrome有一个问题?我在ubuntu上运行它
(function (app) {
    // ...
})(window.app || (window.app = {}));