systemjs

How to create an angular 2 build folder when using systemjs.config.js

喜欢而已 提交于 2019-11-29 03:50:53
How to create an angular 2 build folder when using systemjs.config.js My app works fine locally. I need help with my gulp file so I can grab the node modules required and move them to the dist folder ready for deployment. This is my gulp folder: const gulp = require('gulp'); const ts = require('gulp-typescript'); const uglify = require('gulp-uglify'); const concat = require('gulp-concat'); var htmlreplace = require('gulp-html-replace'); var addsrc = require('gulp-add-src'); var sass = require('gulp-sass'); var inject = require('gulp-inject'); var del = require('delete'); var minifyCss =

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

点点圈 提交于 2019-11-28 21:00:55
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.1.0\Reflect.js that problem goes away but the next problem emerges saying list is undefined within

Cypress with SystemJS

我的未来我决定 提交于 2019-11-28 13:57:11
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 to load before running any more tests without using cy.wait(5000) ? EDIT Thanks to Dwelle this is the

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

﹥>﹥吖頭↗ 提交于 2019-11-28 12:03:38
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(anonymous function) @ system.src.js:4681(anonymous function) @ system.src.js:4681(anonymous function) @

Angular 2 HTTP “Cannot resolve all parameters for 'AppService'”

谁说胖子不能爱 提交于 2019-11-28 09:38:59
I tried to import the http provider into a service, but I'm getting the following error: Cannot resolve all parameters for 'AppService'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'AppService' is decorated with Injectable. Here are some code snippets: <script src="~/es6-shim/es6-shim.min.js"></script> <script src="~/systemjs/dist/system-polyfills.js"></script> <script src="~/angular2/bundles/angular2-polyfills.js"></script> <script src="~/systemjs/dist/system.src.js"></script> <script src="~/rxjs/bundles/Rx.js"></script> <script src="

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

我们两清 提交于 2019-11-28 09:33:06
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. Max Koretskyi aka Wizard Yes, you need to add systemjs to your angular-cli and use it to load a module. Then you can use componentFactoryResolver to resolve the

Typescript module systems on momentJS behaving strangely

自闭症网瘾萝莉.ら 提交于 2019-11-28 07:30:01
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()); //this works moment(new Date()); //this doesn't work I found a workaround to make them both work

How can you bundle Angular 2 using System JS Builder?

佐手、 提交于 2019-11-28 07:27:50
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 figure out how I can bundle Angular 2 itself, or at least the modules required from Angular 2, as they

How to set animation on first element on loading?

本秂侑毒 提交于 2019-11-28 05:22:56
问题 I am using Angular2 with SystemJs. I am wondering how can I set some animation (like fade-out effect) on the Loading label in this example. We can see the label before the application loads. Is there a way to add fade out effect when the content of the following changes (index.html): <body> <my-app>loading...</my-app> </body> 回答1: CSS leaves some room for improvement @Component({ selector: 'my-app', template: ` <router-outlet></router-outlet> `, directives: [ROUTER_DIRECTIVES], host: { '

Angular2 - Angular-CLI installing lodash - Cannot find module

回眸只為那壹抹淺笑 提交于 2019-11-28 03:16:02
问题 Mac OSX El capitan | angular-cli: 0.1.0 | node: 5.4.0 | os: darwin x64 I try to install a 3rd party npm module according to the angular-cli wiki: https://github.com/angular/angular-cli/wiki/3rd-party-libs but fail. I've been struggling with this for days now and would greatly appreciate any help. Steps to get the error: ng new lodashtest3 cd lodashtest3 npm install lodash --save typings install lodash --ambient --save angular-cli-build.json: module.exports = function(defaults) { return new