systemjs

Issue getting Karma 1.1.0 and Angular 2 tests working

时光总嘲笑我的痴心妄想 提交于 2019-12-22 05:26:04
问题 I use Karma 1.1.0. Here is my karma.shim: 'use strict'; // Tun on full stack traces in errors to help debugging Error.stackTraceLimit = Infinity; jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; // // Cancel Karma's synchronous start, // // we will call `__karma__.start()` later, once all the specs are loaded. __karma__.loaded = function() {}; var map = { 'app': 'base/app', 'rxjs': 'base/node_modules/rxjs', '@angular': 'base/node_modules/@angular' }; // packages tells the System loader how to load

Angular2 Material Design alpha.9-3 has '404 not found' for @angular/material

孤人 提交于 2019-12-22 05:09:37
问题 I have followed the instructions at angular material2 Getting Started to install @angular/material. Via Atom, I updated package.json, app.module, and beyond the Getting Started instructions, I updated systemjs.config, as follows: '@angular/material':'node_modules/@angular/material', I get these errors: zone.js:1274 GET http://localhost:3000/node_modules/@angular/material/ 404 (Not Found) (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/node_modules/@angular/material(…) I

Angular2 lazy loading modules: how to create a build package with SystemJS Builder?

﹥>﹥吖頭↗ 提交于 2019-12-22 04:17:11
问题 i'm using Angular2 and SystemJS to create a web application. I have some modules in my app and in the router configuration i use lazy loading to open them. Here is a routing file of my app that lazy loads two modules: const appRoutes: Routes = [ { path: '', component: MainComponent, canActivate: [AuthGuard], children: [ { path: 'dashboard', component: DashboardComponent }, { path: 'first-section', loadChildren: 'app/modules/FIRST-SECTION/first-section.module' }, { path: 'second-section',

Angular2 lazy loading a route issue

丶灬走出姿态 提交于 2019-12-22 00:39:17
问题 Angular2 lazy loading a route issue. I'm using Angular2, typscript, html5 and systemjs. I'm trying to get lazy loading working for one of my basic routes. This is the blog I'm following but I can't seem to get it working: http://blog.angular-university.io/angular2-ngmodule/ This is the console error I get: Uncaught (in promise): Error: Cannot match any routes. URL Segment: '500' My page is the 500 page. Below I have added my files at there current state. Module for 500 page: import { NgModule

Is there a way to use angular 2 without any module loader?

心不动则不痛 提交于 2019-12-21 09:14:05
问题 The Quickstart section on the angular 2 official site describes how to run the simpliest angular 2 application. By default SystemJS is used as module loader. Also there is a note, saying that there are alternatives that work just fine. I understand the benefits of module loaders, but is there a way to run angular 2 app without any module loader at all? When I simply delete SystemJS configuration and SystemJS source script tag, I get an error in console in angular2.dev.js file: Uncaught

Is there a way to use angular 2 without any module loader?

怎甘沉沦 提交于 2019-12-21 09:13:05
问题 The Quickstart section on the angular 2 official site describes how to run the simpliest angular 2 application. By default SystemJS is used as module loader. Also there is a note, saying that there are alternatives that work just fine. I understand the benefits of module loaders, but is there a way to run angular 2 app without any module loader at all? When I simply delete SystemJS configuration and SystemJS source script tag, I get an error in console in angular2.dev.js file: Uncaught

Multiple modules in Angular 2

拜拜、爱过 提交于 2019-12-21 04:52:42
问题 I have an Angular 2 app (RC7) which started as a single component but is quickly becoming used throughout the project in various different (and sometimes completely unrelated) ways. As a result of this, a single NgModule bootstrapping all the components seems like a terrible idea with a huge amount of bloat. I am struggling to find a way to have multiple modules (Module A would contain Component A, Module B would have Component B, etc) and still allow the bootstrapping of multiple A2

How to create angular2 library which could be supported by all script loaders

送分小仙女□ 提交于 2019-12-21 03:53:33
问题 How can I create a javascript file that contains an Angular 2 module that can be used by other applications, but is loaded at runtime directly from a centralized server and is NOT bundled into a specific application's code? Think of this as a CDN for an Angular 2 library. The requirement is that the consumers of this library will include a single script on their page. It is a requirement to implement it this way, so I am not interested in any answers that suggest bundling the library into the

ES6 imports - what does the exclamation mark mean?

£可爱£侵袭症+ 提交于 2019-12-21 03:53:12
问题 I'm following along with the Choose ES6 Modules Today guide, and I noticed one of the import statements he's using has an exclamation mark at the end: import 'bootstrap/css/bootstrap.css!'; What does that exclamation mark signify? This import statement appears on the first line of the startup.js file. 回答1: It means that a plugin will be called to load the file. By default the plugin/loader name equals the extension name. So in your example the css plugin will be called to load the bootstrap

Can system.js replace require.js

做~自己de王妃 提交于 2019-12-21 03:42:55
问题 I'm using requirejs in a large project. This project will soon be upgraded to angular2. Angular2 uses system.js, so I'm thinking of switching to system.js too. Should I be able to remove the reference to the requirejs library and include system.js instead and expect it to work, or is there something I don't understand here? I tried by just removing the require.js file and adding the system.js file instead, but I get error messages saying define is not defined. Can you help? Will I need