systemjs

What is the need for SystemJS in Angular2?

大城市里の小女人 提交于 2019-11-28 03:06:12
I am a complete beginner to Angular and Angular2. I am confused about how the workflow is structured. I have been looking at the sample project that is present in the Angular2 site. Correct me if I am wrong but what I know till now is that all the typescript is transpiled into javascript by the typescript compiler. Then the compiled javascript is actually what runs in the browser. Now if I am importing the javascript files into typescript using ES6 import statements like the following-: import { NgModule } from '@angular/core'; Why do I again need to use SystemJS to load them -: map: { // our

How can I improve load performance of Angular2 apps?

和自甴很熟 提交于 2019-11-27 16:55:57
Angular2 app is loading slow, how can I improve the performance on load? I use Angular2, typescript with html5. currently my app takes 4 seconds to load. I host with Firebase and use cloudflare. Things I'm doing / info: I've compressed images. I minify css I minify js. I use async on my scripts. My scripts are in my . The scripts are around 700kb I used google speed test and get 65% I used minified version of the libs I use e.g. bootstrap etc. Using systemjs. This is the seed app im using: https://github.com/mgechev/angular-seed Flow: When the app loads it shows a blue screen (this is the

Angular2 + Jspm.io : reflect-metadata shim is required when using class decorators

爷,独闯天下 提交于 2019-11-27 13:23:42
问题 I am having the following problem running the below versions of JSPM with Angular2 and SystemJS (Versions: Angular@2.0.0-alpha.27 with JSPM@0.16.0-beta.2 and SystemJS@0.18.0) That once the typescript is compiled (without errors) i get the following error in the browser: /jspm_packages/npm/angular2@2.0.0-alpha.27/src/util/decorators.js:70 Uncaught reflect-metadata shim is required when using class decorators Now when i manually include the file Reflect.js: \jspm_packages\npm\reflect-metadata@0

Cypress with SystemJS

风流意气都作罢 提交于 2019-11-27 08:09:32
问题 I am attempting to create some basic tests to try out the new Cypress library. In my test I have cy.visit('http://mywebsite.com'); which is loading an AngularJS app that uses SystemJS. If I understand Cypress correctly, I shouldn't have to do anything else and it will make sure the page is loaded before running anything else. However this doesn't seem to be working because the page is loaded, but SystemJS is still loading the modules. How can I get Cypress to wait for all the SystemJS modules

SystemJS loads many files for rxjs

孤人 提交于 2019-11-27 06:50:49
问题 I have the following systemjs.config.js (based on some example I found on the internet): (function (global) { System.config({ paths: { // paths serve as alias 'js:': 'js/', }, // map tells the System loader where to look for things map: { // our app is within the app folder app: 'app', // angular bundles '@angular/core': 'js:angular2/core.umd.js', '@angular/common': 'js:angular2/common.umd.js', '@angular/compiler': 'js:angular2/compiler.umd.js', '@angular/platform-browser': 'js:angular2

How to load RxJS (and zone.js / reflect-metadata) with Angular 2 (beta and newer)?

前提是你 提交于 2019-11-27 06:49:32
问题 As of Angular 2 Alpha 54 (changelog), RxJS is no longer included in Angular 2. Update: Turns out that zone.js and reflect-metadata are also excluded. As a result, I now get the following errors (as seen in the Chrome dev console): system.src.js:4681 GET http://localhost:3000/rxjs/Subject 404 (Not Found)F @ system.src.js:4681(anonymous function) @ system.src.js:4681(anonymous function) @ system.src.js:4681(anonymous function) @ system.src.js:4681(anonymous function) @ system.src.js:4681

SystemJS: Why am getting error jquery_1.default is not a function when importing jquery

廉价感情. 提交于 2019-11-27 06:43:16
问题 I have installed foundation via jspm install foundation, then import foundation and jquery. The problem I am having is that if I import jquery via import $ as 'jquery' I get the error jquery_1.default is not a function. If I import jquery via import * as $ from jquery it works as expected I am calling $(document).foundation(); to initialize foundations javascript components. Below is my main.ts import 'foundation' import $ from 'jquery'; import {Aurelia} from 'aurelia-framework'; export

Angular no provider for NameService

江枫思渺然 提交于 2019-11-27 06:14:38
I've got a problem loading a class into an Angular component. I've been trying to solve it for a long time; I've even tried joining it all in a single file. What I have is: Application.ts /// <reference path="../typings/angular2/angular2.d.ts" /> import {Component,View,bootstrap,NgFor} from "angular2/angular2"; import {NameService} from "./services/NameService"; @Component({ selector:'my-app', injectables: [NameService] }) @View({ template:'<h1>Hi {{name}}</h1>' + '<p>Friends</p>' + '<ul>' + ' <li *ng-for="#name of names">{{name}}</li>' + '</ul>', directives:[NgFor] }) class MyAppComponent {

What are differences between SystemJS and Webpack?

拈花ヽ惹草 提交于 2019-11-27 05:46:36
I'm creating my first Angular application and I would figure out what is the role of the module loaders. Why we need them? I tried to search and search on Google and I can't understand why we need to install one of them to run our application? Couldn't it be enough to just use import to load stuff from node modules? I have followed this tutorial (that uses SystemJS) and it makes me to use systemjs.config.js file: /** * System configuration for Angular samples * Adjust as necessary for your application needs. */ (function(global) { // map tells the System loader where to look for things var map

Build Angular2 HTML and TypeScript to a single file

偶尔善良 提交于 2019-11-27 03:35:44
I'm putting together an app (Large scale) using Angular2 and TypeScript. It will need to be divided into numerous projects and each project will have numerous components each with a .html view, .css stylesheet and .ts logic / class. I would like each project to compile to a single *.js file and be copied to a host website which will run in IIS. This would be similar to how a WPF or Silverlight app is built with the .xaml files all getting compiled into the .dll . I've had a look around the web and am able to get the .ts files to build to a single .js file using the --outFile option. But this