<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="app.css" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.27/system.src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.17/angular2-polyfills.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.17/Rx.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.17/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.17/upgrade.dev.js"></script>
<body>
<h1>Angular 1 to 2</h1>
<script>
angular.element(document).ready(function () {
var upgrade_1 = require('angular2/upgrade');
var upgradeAdapter = new upgrade_1.UpgradeAdapter();
upgradeAdapter.bootstrap(document.body, ['app'], { strictDi: true });
});
</script>
</body>
</html>
以上是我试图用来为 angular2 设置升级适配器的 html。
我目前只是试图加载升级适配器。script 标签中的上述代码是示例 typescript 代码根据 Angular 网站遵从 js 的内容。https://angular.io/docs/ts/latest/guide/upgrade.html#!#bootstrapping-hybrid-angular-1-2-applications
问题是我不断收到以下错误:“'require'未定义”。
为什么systemjs没有加载它?