Breeze / breeze-client

Breeze for JavaScript clients
MIT License
38 stars 16 forks source link

Using AjaxPostWrapper in TypeScript version #39

Closed graphicsxp closed 3 years ago

graphicsxp commented 3 years ago

Hello

would you have a sample that shows how to use the AjaxPostWrapper in TypeScript ? I've used it in the past with the JavaScript version but cannot figure out how to use it now.

I guess it should be called in the constructor of my app module (angular) in a similar way

     export class AppModule {
    constructor( http: HttpClient) {
    ModelLibraryBackingStoreAdapter.register();
    UriBuilderJsonAdapter.register();
    AjaxHttpClientAdapter.register(http);
     DataServiceWebApiAdapter.register();
     AjaxPostWrapper.wrapAjax(  /*  WHAT DO I PASS HERE ?    */)
  }
graphicsxp commented 3 years ago

in the end I did that and it works :
AjaxPostWrapper.wrapAjax(AjaxHttpClientAdapter.register(http));

can you just conrfirmed this is the correct way ?

steveschmitt commented 3 years ago

Looks good to me!