systemjs

Running Angular2 In Subdirectory

家住魔仙堡 提交于 2019-11-30 06:07:11
I have an app which runs fine under localhost. I tried to put it out on an IIS server today as a child application. So the new path would be localhost/SubDir. System.js pukes everywhere trying to load modules now. I set the basePath and played with the path/map config variables for a few hours but couldn't land on the magic settings. Does anyone have ideas what I'd want to tweak, or anything that would help with debugging? Chrome Console Chrome Network Index HTML <html> <head> <script src="~/node_modules/es6-shim/es6-shim.js"></script> <script src="~/node_modules/systemjs/dist/system.src.js"><

SystemJS (Aurelia with jspm) fails to load “aurelia-pal-browser” from jspm_packages folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 04:08:51
问题 I've followed the instructions at https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH, step 3-5 to install Aurelia in to my asp.net mvc core app (i.e. running npm install, jspm init, jspm install aurelia-framework and jspm install aurelia-bootstrapper). My "startup code" just looks like this for now: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> SystemJS.import('aurelia-bootstrapper'); </script> When I run the application

Interface based programming with TypeScript, Angular 2 & SystemJS

橙三吉。 提交于 2019-11-30 03:44:03
问题 I'm currently trying to clean up some code in order to program against interfaces rather than against implementations but can't figure out how to. To be more specific, I'm using: * TypeScript 1.5.0 beta -> transpiled to ES5 / commonjs * SystemJS to load the modules I currently try to use external modules as follows: posts.service.ts file: ///<reference path="../../../typings/tsd.d.ts" /> ///<reference path="../../../typings/typescriptApp.d.ts" /> ... export interface PostsService{ // 1

Loading modules in TypeScript using System.js

爷,独闯天下 提交于 2019-11-30 02:47:32
问题 I have a Node.js & AngularJS app written in TypeScript, in which I'm trying to load modules using System.js. It works fine if I only import a class to specify a type. e.g: import {BlogModel} from "./model" var model: BlogModel; However, when I try to instantiate a variable with an imported class, I get an exception at run-time. e.g: import {BlogModel} from "./model" var model: BlogModel = new BlogModel(); Uncaught ReferenceError: require is not defined I use CommonJS. I cannot use AMD because

Angular2 2.0.x and Rx 5 beta.12 bundle

吃可爱长大的小学妹 提交于 2019-11-29 16:52:26
I am currently updating the dependencies of my project which uses the Angular2 npm packages and therefore RxJs as well. I am updating to the 2.0.2 stable release of angular which depends on Rx5 beta.12. For my web application i only deploy the Rx.min.js bundle and load it with a script tag in my index.html file. That approach worked perfectly before with the Rx umd bundle, but causes errors meanwhile, since it appears to me that the contributors of RxJs dropped the different bundle versions for the sake of one common bundle file. i.e. Rx.js instead of Rx.umd.js and so on. I am using SystemJs

Angular2 GZIP issue when I run my app

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 12:47:23
I have an angular2 typescript app. I host with Firebase and use cloudflare for speed, caching and protection. The browser header says: accept-encoding:gzip, deflate, sdch, br This gets converted to a app.js file and is minified now to 1.6mb. I then GZIP Compressed this app.js file. I'm wanting to use the app.js file that is now GZIP compressed rather than the original 1.6mb app.js file. Therefore, I point to the app.js.gz file in my index.html page and I get a browser error called: app.js.gz:1 Uncaught SyntaxError: Invalid or unexpected token Below is a screen grabs of my app.js file and index

Get json file for karma unit test

倖福魔咒の 提交于 2019-11-29 12:35:45
I want to get a JSON file in my unit test because I need to have it for my tests but I dont know how I can include the file I run my test with karma and Jasmine. And my project is created with Angular 2. The name of my JSON file is 'www/assets/mocks/emptyCalendarData.JSON' . Does someone know how I can include a JSON file into a spec file? Thanks UPDATE I tried to use HTTP get but then I got a system let calendarData: Calendar; http.get('www/assets/mocks/emptyCalendarData.json') .map(res => res.json()) .subscribe( data => calendarData = data, err => console.log(JSON.stringify(err)) ); Then I

How to set animation on first element on loading?

半城伤御伤魂 提交于 2019-11-29 11:41:35
I am using Angular2 with SystemJs. I am wondering how can I set some animation (like fade-out effect) on the Loading label in this example . We can see the label before the application loads. Is there a way to add fade out effect when the content of the following changes (index.html): <body> <my-app>loading...</my-app> </body> CSS leaves some room for improvement @Component({ selector: 'my-app', template: ` <router-outlet></router-outlet> `, directives: [ROUTER_DIRECTIVES], host: { '[class.loaded]': 'isLoaded', }, }) @RouteConfig([ {path: '/', name: 'Main View', component: MainViewComponent} ]

Troubles with importing classes from Angular 2 modules with Typescript 1.7

跟風遠走 提交于 2019-11-29 11:17:03
问题 I am having some trouble understanding how to import classes from Modules in TypeScript, specifically for Angular 2 in Visual Studio 2015 (update 1) with TypeScript 1.7. Everywhere in the Angular 2 documentation I see import statements such as: import {Component} from 'angular2/core'; . These files are in node_modules/angular2/* . What makes just angular2/* work? I can only get rid of the errors in Visual Studio when I have a relative path from the app directory such as: ./../node_modules

Angular 5 - load modules (that are not known at compile time) dynamically at run-time

橙三吉。 提交于 2019-11-29 09:41:22
问题 Is it possible for Angular 5 to load modules/components that are not known at compile time, but during runtime dynamically? I guess this won't work using webpack but maybe using system.js? EDIT: The whole idea is to build a plugin based application where individual plugins are dropped inside a plugin folder, angular will pick it automatically, without having to recompile and deploy the whole angular app. Where plugins are separate pieces of functionalities. Of course there are routes