This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule, ValueProvider } from '@angular/core'; | |
import { HttpModule, Http, XHRBackend, RequestOptions } from '@angular/http'; | |
//Custom Http | |
import { HttpSubjectService } from './httpSubject.service'; | |
import { CustomHttp as SxpCustomHttp } from './customHttp'; | |
/** | |
* Das HTTP Module was alle Providers enthält. KEINE Components oder Pipes! | |
* Dieses Modul darf NUR ins CoreModules einbegunden werden. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { HttpSubjectService } from "../HttpInterception/httpSubject.service"; | |
import { Homeservice } from "../HttpServices/home.service"; | |
@Component({ | |
selector: 'app', | |
templateUrl: './app.component.html', | |
}) | |
export class AppComponent { | |
private locals: AppLocalsModel = new AppLocalsModel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Subject } from 'rxjs/Subject'; | |
@Injectable() | |
export class HttpSubjectService { | |
//Wir registrieren ein Subject welches wir an anderer Stelle per Subscribe abfragen können | |
//Subscribe wird aufgerufen, wenn die Next Funktion ausgelöst wurde. Die Next Funktion wird im | |
//CustomHttp an der passenden Stelle aufgerufen für das jeweilige Subject. | |
//https://github.com/ReactiveX/rxjs/blob/master/doc/subject.md | |
public notificationSubject = new Subject(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Http, ConnectionBackend, Request, RequestOptions, RequestOptionsArgs, Response } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { HttpSubjectService as SxpHttpSubjectService } from './httpSubject.service'; | |
//http://restlet.com/blog/2016/04/18/interacting-efficiently-with-a-restful-service-with-angular2-and-rxjs-part-3/ | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"start": "webpack-dev-server --inline --progress --port 8080", | |
"typings": "typings", | |
"postinstall": "typings install" | |
}, | |
"dependencies": { | |
"@angular/common": "~2.2.0", | |
"@angular/compiler": "~2.2.0", | |
"@angular/core": "~2.2.0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Angular2MitWebpack2.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
[AllowAnonymous] | |
public ActionResult Index() | |
{ | |
//die Index.html wird von WebPack in das Verzeichnis kopiert und die Standardroute | |
//lädt dann automatisch die index.html | |
return new FilePathResult("~/wwwroot/index.html", "text/html"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RouteConfig | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
name: "Default", | |
url: "{controller}/{action}/{id}", | |
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<title>Angular2 Mit WebPack 2</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> | |
<!-- base url --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var helpers = require('./helpers'); | |
var webpackMerge = require('webpack-merge'); // used to merge webpack configs | |
var commonConfig = require('./webpack.common.js'); // the settings that are common to prod and dev | |
/** | |
* Webpack Plugins | |
*/ | |
var DefinePlugin = require('webpack/lib/DefinePlugin'); | |
var LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); | |
var WebpackNotifierPlugin = require('webpack-notifier'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var helpers = require('./helpers'); | |
var path = require('path'); | |
var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); | |
var ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); |