systemjs

Cannot start Aurelia app without eval()

假装没事ソ 提交于 2019-12-11 04:52:44
问题 I have a working Aurelia SPA web app, but if I set in my web.config the Content-Security-Policy option like this <add name="X-Content-Security-Policy" value="default-src 'none'; frame-src 'self'; script-src 'self' https://code.jquery.com; connect-src 'self' https://*.core.windows.net; img-src 'self' data:; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src https://fonts.gstatic.com 'self';"></add> I get this error on page load Uncaught (in promise) Error: (SystemJS)

How do I properly set up my systemjs.config for use with ng2-codemirror?

强颜欢笑 提交于 2019-12-11 04:45:31
问题 I am attempting to import the codemirror ng2 module for use in an angular 2 app I am writing, and running into some setup issues. In doing this, I'm trying to follow along with my ng2-datetime-picker import, which DID work. Here is my system.js.config (function (global) { System.config({ path: { 'npm:' : 'node_modules/' }, map: { app: 'app', // ..... // a bunch of angular libraries // ...... 'ng2-datetime-picker': 'npm:ng2-datetime-picker/dist', // this works 'ng2-codemirror: 'npm:ng2

TypeError: Ajv is not a constructor

橙三吉。 提交于 2019-12-11 04:25:32
问题 I have this class where I try to instantiate Ajv with the new keyword and I get this error: TypeError: Ajv is not a constructor Code: import * as Ajv from "ajv"; export class ValidateJsonService { validateJson(json, schema) { console.log(Ajv); let ajv = new Ajv({ allErrors: true }); if (!ajv.validate(schema, json)) { throw new Error("JSON does not conform to schema: " + ajv.errorsText()) } } } The console log: This code used to be working and it is how Ajv is used. From the Ajv docs: The

How to reference library already defined at app level in Aurelia ViewModel

℡╲_俬逩灬. 提交于 2019-12-11 02:47:11
问题 Sytemjs is defined in index.html so technically you can do System.import from anywhere in your application and it will work. However during the build, my component which dynamically imports a library when it is used, gives an error: error TS2304: Cannot find name 'System' Here is the component code: import { bindable, bindingMode, customElement, noView } from 'aurelia-framework'; @noView() @customElement('scriptinjector') export class ScriptInjector { @bindable public url; @bindable public

Angular2 & SystemJS : Cannot find module while building a moduleLoader

。_饼干妹妹 提交于 2019-12-11 02:22:10
问题 What is the context ? I'm working on a project using SystemJS, Angular2 and @ngrx/store. At the moment, I'm trying to make a simple module loader. It works well. Here is the thing : I write a "module" in it's own folder named as follow : namespace @ moduleName . I add this folder into another one named modules . When my app starts, my ModuleLoader (which basically make modules available through import {} from 'namespace@moduleName ) request a server API (using Node). Beside this API, a script

configure angular-cli to use SystemJS

随声附和 提交于 2019-12-11 01:53:46
问题 I know that angular-cli has moved to webpack from SystemJS. But for a specific problem (Posted here) I need to load/assemble my project at client side, so I prefer SystemJS. Right now the project is running with angular-cli default configuration and lots of functionality is been developed. So I need a very easy way to move to SystemJS from Webpack. Can any one please help me regarding that? Note: I do not want to compromise angular-cli advantages like :code generation, unit test etc. My

SystemJS: loading jQuery

自作多情 提交于 2019-12-11 01:34:23
问题 I'm using Angular2, and I'd like to include jQuery. systemjs.config.js (function (global) { System.config({ paths: { 'npm:': 'node_modules/', 'jquery': "//code.jquery.com/jquery-2.1.4.min.js" }, meta: { bootstrap: { deps: ['jquery'] } }, ..... } In app.module.ts , I got the error : Cannot find the module 'jquery' when I put : import $ from 'jquery'; I try it using map instead of paths, but the same result.. 回答1: The correct code is .. import * as $ from 'jQuery'; Also should u be mapping to a

Relative Paths for SystemJS & ES module imports

╄→尐↘猪︶ㄣ 提交于 2019-12-11 00:54:01
问题 I'm having an issue with importing Angular2 components when using SystemJS and ES import syntax. Project structure: ROOT |_src |_client |_app |_frameworks |_il8n |_analytics |_main |_components |_pages |_utility Let's say I have a file: ROOT/src/client/app/frameworks/il8n/language-service.ts and another file: ROOT/src/client/app/main/pages/login/login.ts . In login.ts I want to import language.ts, so one way to do that is like so: //login.ts import { LanguageService } from '../../../..

Angular2 systemjs issues

我只是一个虾纸丫 提交于 2019-12-10 22:25:24
问题 I have this simple TypeScript Angular 2 example: test.ts import {Component} from 'angular2/core'; @Component({ selector: 'my-app', template: '<div>Test</div>' }) export class TestComponent {} main.ts import {bootstrap} from 'angular2/platform/browser' import {TestComponent} from './components/test.component/test' bootstrap(TestComponent); index.html <html> <head> <title>This is an Angular 2 test</title> <!-- Angular dependencies --> <script src="/node_modules/es6-shim/es6-shim.js"></script>

Issues with ES6 import [SystemJS 0.20.9 + TypeScript + Angular 2 + jspm 0.17.0-beta.40]

守給你的承諾、 提交于 2019-12-10 18:36:33
问题 I am trying to set up Angular 2 application with all the new tools (jspm 0.17.0-beta.40). I am transpiling to System module. Here's the tsconfig.json : { "compileOnSave": false, "compilerOptions": { "target": "ES5", "module": "System", "moduleResolution": "Node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "noImplicitAny": true, "rootDir": "../" } } The issue is with ES6 import . After something like this is transpiled: import { Component, ViewEncapsulation, AfterViewInit }