Following an upgrade from Angular 1 to Bootstrap with Angular 2 using the upgrade option, encountering an error after importing Angular with systemJS config:
map: {... 'angular': 'npm:angular/angular.js' ... }
The browser is throwing this error:
systemjs.import error: Error: (SystemJS) angular.module is not a function
TypeError: angular.module is not a function
at execute (http://msoqa05.devlab.ad:8088/home/bl/app.module.js:88:21)
at ZoneDelegate.invoke (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="354f5a5b501b5f4675051b021b01">[email protected]</a>?main=browser:242:26)
at Zone.run (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e2988d8c87cc8891a2d2ccd5ccd6">[email protected]</a>?main=browser:113:43)
at https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d5afbabbb0fbbfa695e5fbe2fbe1">[email protected]</a>?main=browser:520:57
at ZoneDelegate.invokeTask (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ee4f1f0fbb0f4eddeaeb0a9b0aa">[email protected]</a>?main=browser:275:35)
at Zone.runTask (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="403a2f2e256e2a3300706e776e74">[email protected]</a>?main=browser:151:47)
at drainMicroTaskQueue (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c6673727932766f5c2c322b3228">[email protected]</a>?main=browser:418:35)
at XMLHttpRequest.ZoneTask.invoke (https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a0015141f5410093a4a544d544e">[email protected]</a>?main=browser:349:25)
Error loading http://msoqa05.devlab.ad:8088/home/bl/app.module.js
Confusion arises about needing to map Angular inside systemjs.config in order to import it. Is this necessary?
Attempting to downgrade an Angular 2 component within app.module.ts:
import * as angular from 'angular';
import { downgradeComponent } from '@angular/upgrade/static';
angular.module('myApp')
.directive(
'helloWorld',
downgradeComponent({component: HelloWorldComponent}) as angular.IDirectiveFactory
);
TypeScript compilation appears successful, but the browser throws an error. Is angular.module fundamental to AngularJS?