systemjs

Running Angular2 In Subdirectory

守給你的承諾、 提交于 2019-12-18 12:15:40
问题 I have an app which runs fine under localhost. I tried to put it out on an IIS server today as a child application. So the new path would be localhost/SubDir. System.js pukes everywhere trying to load modules now. I set the basePath and played with the path/map config variables for a few hours but couldn't land on the magic settings. Does anyone have ideas what I'd want to tweak, or anything that would help with debugging? Chrome Console Chrome Network Index HTML <html> <head> <script src="~

Angular2 2.0.x and Rx 5 beta.12 bundle

别等时光非礼了梦想. 提交于 2019-12-18 09:34:18
问题 I am currently updating the dependencies of my project which uses the Angular2 npm packages and therefore RxJs as well. I am updating to the 2.0.2 stable release of angular which depends on Rx5 beta.12. For my web application i only deploy the Rx.min.js bundle and load it with a script tag in my index.html file. That approach worked perfectly before with the Rx umd bundle, but causes errors meanwhile, since it appears to me that the contributors of RxJs dropped the different bundle versions

Angular2 GZIP issue when I run my app

人走茶凉 提交于 2019-12-18 07:19:41
问题 I have an angular2 typescript app. I host with Firebase and use cloudflare for speed, caching and protection. The browser header says: accept-encoding:gzip, deflate, sdch, br This gets converted to a app.js file and is minified now to 1.6mb. I then GZIP Compressed this app.js file. I'm wanting to use the app.js file that is now GZIP compressed rather than the original 1.6mb app.js file. Therefore, I point to the app.js.gz file in my index.html page and I get a browser error called: app.js.gz

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

萝らか妹 提交于 2019-12-17 19:17:34
问题 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

How to import `Observable` from `Rx` (not angular)

这一生的挚爱 提交于 2019-12-17 18:59:08
问题 I'm using SystemJS to load my es2015 project into the browser. This is what I did import {Observable} from 'rxjs/Rx'; const button = document.querySelector('button'); const start$ = Observable.fromEvent(button, 'click'); In this case Observable is undefined . So I tried import Observable from 'rxjs/Observable'; In which case Observable is an object but Observable.fromEvent is undefined (it seems to be an empty object) Finally I did import Rx from 'rxjs/Rx' // Rx.Observable which did work. Any

What is the need for SystemJS in Angular2?

江枫思渺然 提交于 2019-12-17 17:24:47
问题 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-:

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

独自空忆成欢 提交于 2019-12-17 04:14:47
问题 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] }); 回答1: The beta release of Angular (since vesion 2-alpha.51) supports relative assets for components, like templateUrl and styleUrls in the @Component decorator.

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

对着背影说爱祢 提交于 2019-12-17 04:14:13
问题 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] }); 回答1: The beta release of Angular (since vesion 2-alpha.51) supports relative assets for components, like templateUrl and styleUrls in the @Component decorator.

How do you deploy Angular apps?

牧云@^-^@ 提交于 2019-12-17 03:47: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? 回答1: You are actually here touching two questions in one. The

unable to import electron modules from the BrowserWindow page

十年热恋 提交于 2019-12-14 03:53:55
问题 I have a angular2/typescript application that I am having loaded into the electron BrowserWindow. The modules for this are loaded via SystemJS. But, when I run it via launching electron, I get an error from the SystemJS loader where it is trying to load the electron module from the file system. Does anyone have any recommendation as what I need to configure in SystemJS to map it such that it can find the electron module? I did not see any js to map to in electron-prebuilt. Update Added the