systemjs

Browser test setup: How to make already global SystemJS module available to require('systemjs') of tested code?

百般思念 提交于 2019-12-14 03:26:21
问题 I have code that is fairly system independent and with few system dependent lines of code runs on node.js or the browser. I already managed to setup mocha-based testing so that it works in both those environments, using the same tests and the same code modules. I also managed the browser testing environment to automatically swap calls for those very few system-dependent packages that always call the node.js version for the browser version. So everything runs, including mocha and sinon and all

How to configure SystemJs for ImmutableJs to work in Angular 2 project

早过忘川 提交于 2019-12-13 17:36:18
问题 so i am trying to import ImmutableJs into my angular 2 project, i am using this kind of systemjs config (function(global) { // map tells the System loader where to look for things var map = { 'src/client': 'src/client', // 'dist', '@angular': 'node_modules/@angular', 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 'rxjs': 'node_modules/rxjs', 'highcharts': 'node_modules/highcharts', 'angular2-highcharts': 'node_modules/angular2-highcharts', 'immutable': 'node_modules

Angular 2.2 Dynamically load components using System.import

本小妞迷上赌 提交于 2019-12-13 17:30:51
问题 In my Angular RC5 app I used the following code to dynamically load components: public LoadComponentAsync(componentPath: string, componentName: string, locationAnchor: ViewContainerRef) { (<any>window).System.import(componentPath) .then(fileContents => { return fileContents[componentName]; }) .then(component => { this.resolver.resolveComponent(component).then(factory => { let comp = locationAnchor.createComponent(factory, 0, locationAnchor.injector).instance; //... }); }); } A component I was

TypeScript基础入门之模块解析(二)

北慕城南 提交于 2019-12-13 17:06:21
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 转发 TypeScript基础入门之模块解析(二) 模块解析 Base URL 使用baseUrl是使用AMD模块加载器的应用程序中的常见做法,其中模块在运行时"deployed"到单个文件夹。 这些模块的源代码可以存在于不同的目录中,但构建脚本会将它们放在一起。 设置baseUrl通知编译器在哪里可以找到模块。 假定所有具有非相对名称的模块导入都相对于baseUrl baseUrl的值确定为: 1) baseUrl命令行参数的值(如果给定的路径是相对的,则根据当前目录计算) 2) 'tsconfig.json'中baseUrl属性的值(如果给定的路径是相对的,则根据'tsconfig.json'的位置计算) 请注意,设置baseUrl不会影响相对模块导入,因为它们始终相对于导入文件进行解析。 您可以在RequireJS和SystemJS文档中找到有关baseUrl的更多文档。 路径映射(Path mapping) 有时模块不直接位于baseUrl下。 例如,对模块"jquery"的导入将在运行时转换为"node_modules/jquery/dist/jquery.slim.min.js"。 加载程序使用映射配置在运行时将模块名称映射到文件,请参阅RequireJs文档和SystemJS文档

How to start a Typescript app with SystemJS modules?

夙愿已清 提交于 2019-12-13 16:41:59
问题 I am using the typescript compiler to bundle my modules into one main.js file, using these settings in tsconfig.json: "module": "system", "out": "docs/js/main.js" This works, so according to the SystemJS documentation, I only have to include the SystemJS production file and kickstart the app with these tags in my HTML: <script src="js/system.js"></script> <script> SystemJS.import('js/main.js'); </script> My app: import { Message } from "./message"; export class App { constructor() { let

Webpack solution for SystemJS mapping

我是研究僧i 提交于 2019-12-13 07:25:57
问题 The release of AngularCLI abandon SystemJS in favor of WebPack. However SyncFusion hasn't supported WebPack yet in there EJ2 library for Angular. They instruct to use SystemJS to map "@syncfusion/ej2-grids": "node_modules/@syncfusion/ej2-grids/dist/ej2-grids.umd.min.js", "@syncfusion/ej2-ng-grids": "node_modules/@syncfusion/ej2-ng-grids/dist/ej2-ng-grids.umd.min.js", in this tutorial http://ej2.syncfusion.com/angular/documentation/grid/getting-started.html#configuring-system-js How can I work

How to import 'bootstrap-datetimepicker' into Aurelia project

落花浮王杯 提交于 2019-12-13 04:27:16
问题 I'm trying to add 'Eonasdan/bootstrap-datetimepicker' into an Aurelia with typescript project and call this.birthDateDatePicker.datetimepicker(); in the "attached" method from the Aurelia life-cycle. I added: import $ from 'jquery'; import {datepicker} from 'Eonasdan/bootstrap-datetimepicker'; and there was no error, but when I try to inject like this @inject(HttpClient, json, datepicker) I get the following error: GET http://127.0.0.1:8080/jquery.js 404 (Not Found) I'm not sure the two

How to use Electron's <webview> within Angular2 app?

本小妞迷上赌 提交于 2019-12-13 02:54:55
问题 I try to use Electon's webview tag inside my Angular2 app, but when I add the src attribute binded to an Angular2 variable, the following error occurs: Can't bind to 'src' since it isn't a known native property This is the index.html: <head> <!-- cut out stylings, metatags, etc. --> <script src="../node_modules/zone.js/dist/zone.js"></script> <script src="../node_modules/reflect-metadata/Reflect.js"></script> <script src="../node_modules/systemjs/dist/system.src.js"></script> <script src=

Importing external components into angular2 quickstart project with typescript and npm

蹲街弑〆低调 提交于 2019-12-12 19:17:26
问题 I decided to try out angular2, and have been enjoying playing around with it while expanding upon the quickstart in typescript provided by angular.io (alpha 44). However I seem to have hit a snag, I am having a hard time importing new modules I got through node, more specifically the tooltip in ng2-bootstrap. I just can't seem to "get" how the quickstart project all works togheter, even if I have read up on systemjs, and tried tinkering around myself. I have tried various approach but always

Angular2 and SystemJs and Bundling for Production - Help I'm missing something

旧街凉风 提交于 2019-12-12 17:12:18
问题 There is an excellent answer to the question "Angular 2 How to Bundle for Production", see link below: How to bundle an Angular app for production I am most interested in using the strategy described in the answer given to this question with the title: "2.0.1 Final using Gulp (TypeScript - Target: ES5)". This answer does a great job of walking me through every single step. A very basic summary of the strategy is to bundle all the javascript, including the angular core stuff all up into a