zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
167 stars 38 forks source link

adapt ng5: http: deprecate @angular/http in favor of @angular/common/http (#18906) (72c7b6e) #21

Closed zijianhuang closed 6 years ago

zijianhuang commented 6 years ago

Breaking changes:

Class names changed. Not a big deal.

//import { Http, Headers, Response } from '@angular/http';
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';

In angular/http:

        getDecimalSquare(d: number): Observable<number>{
            return this.http.get(this.baseUri + 'api/SuperDemo/decimal?d='+d).map(response=> response.json());
        }

In angular/common/http

        getIntSquare(d: number): Observable<number> {
            return this.http.get<number>(this.baseUri + 'api/SuperDemo/int?d=' + d);
        }

The new lib makes good use of generic and hide more technical details behind. Higher abstraction.

So the generated codes may look shorter.

zijianhuang commented 6 years ago

basically done and tested.

Ready to release after testing in a commercial project.

zijianhuang commented 6 years ago

released as 2.3