Upgrading angular 1 to 2

Discussão em 'Angular' iniciado por Willis, Novembro 13, 2024.

  1. Willis

    Willis Guest

    I'm trying to follow the upgrade steps for Angular 1 to 2. I've put in the following code to allow for a hybrid application:

    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});


    But I'm just getting the following error message in the browser console:

    SyntaxError: import declarations may only appear at top level of a module
    Line: import * as angular from 'angular';

    Continue reading...

Compartilhe esta Página