systemjs

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

扶醉桌前 提交于 2019-11-30 19:56:26
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 I can see on Chrome dev tools that a lot of Aurelia resources (js files) are loaded under the /jspm

Interface based programming with TypeScript, Angular 2 & SystemJS

泪湿孤枕 提交于 2019-11-30 19:27:25
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 fetchPosts(): Rx.Observable<any>; } export var PostsService:PostsServiceImpl; // 2 ... export class

Import unable to locate angular2 in beta.1

社会主义新天地 提交于 2019-11-30 19:01:43
问题 The sample code found in AngularJS 2.0 Getting Started with Visual Studio works with alpha.28 version. When I change the scripts from <script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"></script> <script src="https://jspm.io/system@0.16.js"></script> <script src="https://code.angularjs.org/2.0.0-alpha.28/angular2.dev.js"></script> to <script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"></script> <script src=

Loading modules in TypeScript using System.js

本秂侑毒 提交于 2019-11-30 18:38:33
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 I have one project for both server side and client side. This is why I use System.js to load modules

How to bundle Angular2 RC1 with systemjs

不羁的心 提交于 2019-11-30 17:41:50
Prior to the release candidates angular supplied a bundled file. Since the release candidates there's no more bundled file. Including angular2 and rxjs my app now makes 671 requests over 7secs to load. This has crippled development. Does anyone know how to bundle angular and rxjs and include these in system.config? eko In order to get a lighter weight project you should check SystemJS Builder or JSPM to bundle your project. Example seed project: https://github.com/madhukard/angular2-jspm-seed @BrunoGarcia gave a very nice info here: https://stackoverflow.com/a/37098964/5706293 dygufa You just

Using GeoFire in an Angular2 App

五迷三道 提交于 2019-11-30 16:22:28
问题 I'm trying to set up GeoFire in my Angular2 (RC5) app. I've installed geofire and firebase with npm and configured systemjs to import it. Here's my package.json: { "name": "MyProject", "version": "0.1.0", "scripts": { "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", "lite": "lite-server", "postinstall": "typings install", "tsc": "tsc", "tsc:w": "tsc -w", "typings": "typings" }, "license": "ISC", "dependencies": { "@angular/common": "^2.0.0-rc.5", "@angular/compiler": "^2.0

How can I organize my Angular app folders like a Java package?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 15:31:14
问题 How to organize Angular 2 app folder structure like Java packages? Consider the following project layout: app |_model |_component |_service I would like to import foo.service.ts from service to bar.component.ts in component . But as far as I know, Angular 2 import supports only relative paths like /../service/ , which seems very clunky solution. Is there a way to refer folders with absolute bath from root folder , like with Java packages? 回答1: UPDATE 2016-06-01 using npm install typescript

How can I organize my Angular app folders like a Java package?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 14:14:18
How to organize Angular 2 app folder structure like Java packages? Consider the following project layout: app |_model |_component |_service I would like to import foo.service.ts from service to bar.component.ts in component . But as far as I know, Angular 2 import supports only relative paths like /../service/ , which seems very clunky solution. Is there a way to refer folders with absolute bath from root folder , like with Java packages? UPDATE 2016-06-01 using npm install typescript@next you can already use this function I assume that your tree looks like this: node_modules |_@angular |_rxjs

systemjs-builder: Angular 2 Component Relative Paths cause 404 errors

北城以北 提交于 2019-11-30 09:37:16
问题 This is a cross post to https://github.com/systemjs/builder/issues/611 I'm trying to bundle my Angular 2 rc 1 app with systemjs-builder 0.15.16 buildStatic method. An angular component has a view as well as one or more stylesheets external to the script. They are referred to within the @Component metadata in one of two ways Using absolute paths: @Component({ templateUrl: 'app/some.component.html', styleUrls: ['app/some.component.css'] }) Using the now recommended relative paths: @Component({

Get json file for karma unit test

瘦欲@ 提交于 2019-11-30 09:07:05
问题 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 =>