Skip to content

Commit

Permalink
fix(api-client): models are not imported if there are none
Browse files Browse the repository at this point in the history
* Default to relative path instead of localhost for domain.

* Remove window declare (not needed). Use shorter syntax for setting default address

* Implement default hostname in generator instead of template

* Fixes to domain generation

* Added commnets to generator

* Undo unintended change to template

* Fixed import path to APIClient

* Fixed #31 - array parameters not being added correctly. Rebuilt generated test code.

* Update parser.ts

* test(gcloud-firestore): any corrected to string
  • Loading branch information
warmans authored and vmasek committed Mar 12, 2018
1 parent 5b8bf86 commit 42cf4c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/ngx-module-export.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpHeaders, HttpParams } from '@angular/common/http';
import { APIClient, USE_DOMAIN, USE_HTTP_OPTIONS } from './api-client.service';

{{#definitions.length}}
export * from './models';
{{/definitions.length}}

export { APIClient } from './api-client.service';

export interface HttpOptions {
Expand Down
3 changes: 3 additions & 0 deletions templates/ngx-service.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { HttpOptions } from './';

{{#definitions.length}}
import * as models from './models';
{{/definitions.length}}

export const USE_DOMAIN = new InjectionToken<string>('USE_DOMAIN');
export const USE_HTTP_OPTIONS = new InjectionToken<HttpOptions>('USE_HTTP_OPTIONS');
Expand Down
1 change: 1 addition & 0 deletions tests/gcloud-firestore/api/api-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { HttpOptions } from './';

import * as models from './models';

export const USE_DOMAIN = new InjectionToken<string>('USE_DOMAIN');
Expand Down
1 change: 1 addition & 0 deletions tests/gcloud-firestore/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { HttpHeaders, HttpParams } from '@angular/common/http';
import { APIClient, USE_DOMAIN, USE_HTTP_OPTIONS } from './api-client.service';

export * from './models';

export { APIClient } from './api-client.service';

export interface HttpOptions {
Expand Down

0 comments on commit 42cf4c0

Please sign in to comment.