我正在尝试遵循 Angular 1 到 2 的升级步骤。我输入了以下代码以允许混合应用程序:
import * as angular from 'angular';
import {upgradeAdapter} from './upgrade-adapter';
angular.module('app', []);
angular.bootstrap(document.body, ['app']);
upgradeAdapter.bootstrap(document.documentElement, ['app'], {strictDi: true});
但我只是在浏览器控制台中收到以下错误消息:
SyntaxError: import declarations may only appear at top level of a module
Line: import * as angular from 'angular';