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, Response} from '@angular/http'; | |
import {Observable} from 'rxjs/observable'; | |
import 'rxjs/add/operator/map'; | |
@Injectable() | |
export class Proxyservice { | |
constructor(private http: Http) { } |
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
using ProxyGenerator.ProxyTypeAttributes; | |
public class ProxyController : Controller | |
{ | |
[CreateAngular2TsProxy(ReturnType = typeof(Person))] | |
public JsonResult AddTsEntryOnly(Person person) | |
{ | |
return Json(person, JsonRequestBehavior.AllowGet); | |
} |
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
/// <reference path="../typings/tsd.d.ts" /> | |
// A '.tsx' file enables JSX support in the TypeScript compiler, | |
// for more information see the following page on the TypeScript wiki: | |
// https://github.com/Microsoft/TypeScript/wiki/JSX | |
var Counter = React.createClass({ | |
add: () => { | |
console.log('add 1!'); | |
}, |
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> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>@ViewBag.Title - Meine ASP.NET-Anwendung</title> | |
@Styles.Render("~/Content/css") | |
</head> | |
<body> |
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
//Bundles für die React Bibliothek und Jquery | |
bundles.Add(new ScriptBundle("~/bundles/libraries").Include( | |
"~/Scripts/jquery-{version}.js", | |
"~/node_modules/react/dist/react-with-addons.js", | |
"~/node_modules/react-dom/dist/react-dom.js" | |
)); | |
//Bundle für unsere React Anwendung | |
bundles.Add(new ScriptBundle("~/bundles/app").Include( | |
"~/ScriptsApp/helloWorldTypeScript.js", |
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
{ | |
"author": "SquadWuschel", | |
"description": "Packages für Hello World mit React", | |
"private": true, | |
"dependencies": { | |
"react": "15.3.1", | |
"react-dom": "15.3.1" | |
} | |
} |
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 Hello = React.createClass({ | |
render: function() { | |
return <div>Hello {this.props.name}</div>; | |
} | |
}); | |
ReactDOM.render( | |
<Hello name="World" />, | |
document.getElementById('helloWorld') |
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
module App.AppComponents.Interceptors { | |
consoleInterceptor.$inject = ["$injector", "$q"]; | |
export function consoleInterceptor($injector: ng.auto.IInjectorService, $q: ng.IQService): any { | |
return { | |
// On request success | |
request: function(request) { | |
console.log("Request Success"); | |
console.log(request); |
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 } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
imports: [BrowserModule], | |
declarations: [AppComponent], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
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 ProxyController : Controller | |
{ | |
[CreateAngularTsProxy(ReturnType = typeof(Auto))] | |
public JsonResult AddTsEntryAndName(Person person, string name) | |
{ | |
return Json(new Auto() { Marke = name}, JsonRequestBehavior.AllowGet); | |
} | |
[CreateAngularTsProxy(ReturnType = typeof(Person))] | |
public JsonResult LoadTsCallById(int id) |