systemjs

Get and load a remote component/module in an angular 4.4 app

故事扮演 提交于 2019-11-27 02:58:57
问题 Here is what i'm trying de achieve : I want to create an app using "plugins", by plugins I mean : Another angular component/module that could be deployed on a remote host and displayed in my app. Looks like I can't do such thing with webpack directly and that I should use SystemJs to dynamically load a module. Any advice would be welcome to use SystemJs and Webpack (ng cli), examples of how to call remote module and load them. 回答1: Yes, you need to add systemjs to your angular-cli and use it

Typescript module systems on momentJS behaving strangely

淺唱寂寞╮ 提交于 2019-11-27 01:49:32
问题 I'm trying to use momentJs from typescript: depending on what module system I'm using to compile typescript, I find a different behaviour on how I can use momentJs. When compiling typescript with commonJs everything works as expected and I can just follow momentJs documentation: import moment = require("moment"); moment(new Date()); //this works If I use "system" as typescript module system when I import "moment" I am forced to do import moment = require("moment"); moment.default(new Date());

How can you bundle Angular 2 using System JS Builder?

你。 提交于 2019-11-27 01:49:29
问题 I'm currently using System JS with System JS Builder to bundle up my application, its assets, and the libraries that it references. My problem is that I can bundle libraries that are referenced explicitly in the index.html, e.g: <script src="node_modules/es6-shim/es6-shim.min.js"></script> <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> However, I can't

How can I improve load performance of Angular2 apps?

*爱你&永不变心* 提交于 2019-11-26 18:48:08
问题 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:

Angular2 too many file requests on load

若如初见. 提交于 2019-11-26 18:27:05
I'm making a website using Angular2 and I'm having what i suppose is an issue. On the first load of my angular page, SystemJS is making more than 500 hundred requests to retrieve every Angular2 file in angular2/src directory. In total, the first load downloads more than 4MB and it takes more than 14 seconds to start. My index.html does the following scripts includes: <script src="libs/angular2/bundles/angular2-polyfills.js"></script> <script src="libs/systemjs/dist/system.src.js"></script> <script src="libs/rxjs/bundles/Rx.js"></script> <script src="libs/angular2/bundles/angular2.min.js"><

Angular - What is the meanings of module.id in component?

半腔热情 提交于 2019-11-26 18:21:45
In an Angular app, I have seen that @Component has property moduleId . What does it mean? And when module.id is not defined anywhere, the app still works. How can it still work? @Component({ moduleId: module.id, selector: 'ng-app', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], directives: [AppComponent] }); Nishchit Dhanani The beta release of Angular (since vesion 2-alpha.51) supports relative assets for components, like templateUrl and styleUrls in the @Component decorator. module.id works when using CommonJS. You don't need to worry about how it works. Remember :

How do you deploy Angular apps?

非 Y 不嫁゛ 提交于 2019-11-26 18:05:32
How do you deploy Angular apps once they reach the production phase? All the guides I've seen so far (even on angular.io ) are counting on a lite-server for serving and browserSync to reflect changes - but when you finish with development, how can you publish the app? Do I import all the compiled .js files on the index.html page or do I minify them using gulp? Will they work? Do I need SystemJS at all in the production version? You are actually here touching two questions in one. First one is how to host your application. And as @toskv mentioned its really too broad question to be answered and

How to prepare release version with SystemJS and Gulp?

故事扮演 提交于 2019-11-26 15:02:28
I use SystemJS in my Angular2 project. I use tsconfig file for TypeScript. I want to use gulp to concat and minify my code for production version. I am having an issues with concating the code: each time I try to concat files I get either 'angular' not defined or 'system' not defined. I tried to modify the order that I try to load my files from node modules, however I did not succeeded. I was wondering if any of you had this issues, and found an answer to it? Here is my gulp file: var gulp = require('gulp'), ..... var paths = { dist: 'dist', vendor: { js: [ 'node_modules/systemjs/dist/system

What are differences between SystemJS and Webpack?

风流意气都作罢 提交于 2019-11-26 11:44:48
问题 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

Build Angular2 HTML and TypeScript to a single file

耗尽温柔 提交于 2019-11-26 10:34:27
问题 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