Search Posts

Category: systemjs

Error when loading ngx-restangular: (SystemJS) Module not already loaded loading "@angular/core" as

I’ve upgraded from the AngularJS ‘restangular’ library to the Angular ‘ngx-restangular’ library, as part of an upgrade from AngularJS to Angular. I’m now getting the following error and stack trace and I have no idea why it’s happening: sign-in-redirect Error: (SystemJS) Module not already loaded loading “@angular/core” as http://localhost/node_modules/@angular/core/bundles/core.umd.js. Error: Module not already loaded loading “@angular/core” as http://localhost/node_modules/@angular/core/bundles/core.umd.js. at Object.eval (http://localhost/node_modules/ngx-restangular/dist/umd/ngx-restangular.js:125:19) at __webpack_require__ (http://localhost/node_modules/ngx-restangular/dist/umd/ngx-restangular.js:30:30) at Object.eval (http://localhost/node_modules/ngx-restangular/dist/umd/ngx-restangular.js:86:15) at __webpack_require__ (http://localhost/node_modules/ngx-restangular/dist/umd/ngx-restangular.js:30:30) at Object.eval (http://localhost/node_modules/ngx-restangular/dist/umd/ngx-restangular.js:59:33) at __webpack_require__ […]

jQuery is not defined error in karma tests

I am using jQuery in my angular 5 app which works perfectly but I have an issue with karma tests. import { ElementRef } from ‘@angular/core’; declare var jQuery: any; export class Item { constructor(private element: ElementRef) { this.init(); } private init() { this.$item = jQuery(this.element.nativeElement); … error ReferenceError: jQuery is not defined. package.json “dependencies”: { “jquery”: “3.1.1” } I have added jquery to my karma.conf but that didn’t help. files: [ ‘node_modules/core-js/client/shim.js’, ‘node_modules/systemjs/dist/system.src.js’, ‘node_modules/zone.js/dist/zone.js’, […]

Controller is not registered exception when using SystemJS with Typescript in angular JS

I am trying to implement a page using typescript in AngularJS, but I am not sure what mistake I am doing in integrating the controller to the angular. Based on my understanding, controller IIFE is not getting executed though I have specified the System import in the HTML file. Please find the following files Sample.ts file import * as angular from “angular”; export class Sample{ constructor(nme: string) { this.name = nme; } public name: string; […]

Moving from systemjs to webpack with bootstrap entry

I’m trying to do some examples from the “Mean Web Development” book, when it goes into Angular the code doesn’t properly load into a browser. One of the things I’m trying to do in order to solve the issue is to move from systemjs to webpack. Now, when I run the code with systemjs – it produced *.js extension file for every file with *.ts extension. My first question – Does webpack suppose to do […]

Angular 2 and systemjs doesn’t load

I’m very new to web programming. Trying to go through examples from the “Mean Web Development” second edition book. It went okey until Angular was introduced. I’am trying to run an example from Chapter 7 of this book and the only thing I see in the browser is “Loading…” I can see it complains about: ” Error: (SystemJS) Unexpected token < SyntaxError: Unexpected token < at eval (<anonymous>) Evaluating http://localhost:3000/app Error loading http://localhost:3000/app at eval […]