角度1到2升级

时间:2016-10-07 09:09:04

标签: angularjs angular angular-module ng-upgrade

我试图按照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';

0 个答案:

没有答案