systemjs

(SystemJS) XHR error @angular/commobundles/common.umd.js/http not found

我是研究僧i 提交于 2019-12-01 17:54:15
问题 I am making a simple http request in my application. I am using Angular 2 Quickstart and updating all my angular packages to 4.3.4 This is my package.json { "name": "angular-quickstart", "version": "1.0.0", "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { "build": "tsc -p src/", "build:watch": "tsc -p src/ -w", "build:e2e": "tsc -p e2e/", "serve": "lite-server -c=bs-config.json", "serve:e2e": "lite-server -c=bs-config.e2e.json",

Unexpected value 'FileUploadModule' imported by the module 'UploaderModule' - ng2-file-upload

…衆ロ難τιáo~ 提交于 2019-12-01 17:45:16
Using angular 2.0.1 (release) and ng2-file-upload 1.1.0 (latest version) I am getting the above error upon running this code. I am using jspm with systemjs to bundle my app (all fully up-to-date). import {Component, NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FileUploadModule} from 'ng2-file-upload'; @Component({ selector: 'uploader', templateUrl: '/build/templates/uploader.html' }) export class UploaderComponent { uploader = new FileUploader({url: '/upload'}); hasBaseDropZoneOver = false; fileOverBase(event) { this.hasBaseDropZoneOver = event; }

SystemJS: loading build file

故事扮演 提交于 2019-12-01 14:47:32
My SystemJS file looks like this: (function(global) { // map tells the System loader where to look for things var map = { 'angular2-boot': 'app', // 'dist', '@angular': 'node_modules/@angular', 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 'rxjs': 'node_modules/rxjs' }; // packages tells the System loader how to load when no filename and/or no extension var packages = { // 'app': { main: 'js/main.js', defaultExtension: 'js' }, 'app': { main: 'dist/build.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, 'angular2-in-memory-web-api': { defaultExtension

SystemJS: loading build file

萝らか妹 提交于 2019-12-01 14:00:38
问题 My SystemJS file looks like this: (function(global) { // map tells the System loader where to look for things var map = { 'angular2-boot': 'app', // 'dist', '@angular': 'node_modules/@angular', 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 'rxjs': 'node_modules/rxjs' }; // packages tells the System loader how to load when no filename and/or no extension var packages = { // 'app': { main: 'js/main.js', defaultExtension: 'js' }, 'app': { main: 'dist/build.js',

Angular 2 AOT not like moduleId in my components

僤鯓⒐⒋嵵緔 提交于 2019-12-01 10:20:57
问题 How do I get around this? As far as I know, JIT needs moduleId's on the components to find the template and styles if the component has one. However, AOT doesnt use module and you get a "Cannot find name 'module'" error when compiling for AOT. I don't want to go through all my modules and remove the Id for AOT, as I use JIt for DEV and AOT for production release only in order to get the performance benefits. I've used the new angular 4 seed app for this: https://angular.io/docs/ts/latest

runtime load components or modules into a module in angular2

主宰稳场 提交于 2019-12-01 04:58:17
问题 I have an angular app that are built using Typescript and bundled together with webpack. Nothing unusual here. What i want to do is to allow plugins on runtime, which means that components and/or modules outside the bundle should be able to be registered in the app as well. So far I've tried to include another webpack bundle in index.html and using an implict array to push said module / component into that, and in my module import these. See the imports are using an implict variable. This

Require nodejs “child_process” with TypeScript, SystemJS and Electron

南笙酒味 提交于 2019-12-01 03:36:54
I'm working on a simple nodejs electron (formerly known as atom shell) project. I'm writing it using angular 2, using the project the same project setup as they recommend in the documentation for typescript: tsc: { "compilerOptions": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] } I need to run a command, I found out that I can do it with node "child_process". I couldn't find

How to use momentjs in TypeScript with SystemJS?

荒凉一梦 提交于 2019-12-01 02:09:34
My project's setup includes 'jspm' tool for libraries and 'tsd' tool for typings. After installing moment's TypeScript d.ts file ( these ), I can't find a way to load and actually use a moment instance. In my file (using SystemJS module loading) /// <reference path="../../../typings/tsd.d.ts" /> import * as moment from "moment"; import * as _ from "lodash"; ... ... const now = (this.timestamp === 0) ? moment() : moment(this.timestamp); I get a " TypeError: moment is not a function " The definitions are structured the same as lodash , which works fine, so I don't know what might be the cause.

Import unable to locate angular2 in beta.1

做~自己de王妃 提交于 2019-12-01 01:37:44
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="http://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system.src.js"></script> <script src="https:/

Typescript modules and systemjs. Instantiate class from inline script

萝らか妹 提交于 2019-11-30 21:32:31
问题 I am transpiling a typescript module to javascript with the system module option. I am executing this in a browser. I am able to consume this module when the code to initialize the module class generated by typescript is also loaded using systemjs system.import. How can i make the class which is part of a module available from javascript code not loaded through systemjs? E.g. embeded javascript in the page? 回答1: You can use SystemJS to import the module in Javascript. Assuming you have a