Skip to content

Commit

Permalink
[TypeScriptAngular2Client] Fixed model extend on another model syntax…
Browse files Browse the repository at this point in the history
… error. swagger-api#1334
  • Loading branch information
iain17 committed May 15, 2017
1 parent 80ffbac commit 47794d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
protected String npmName = null;
protected String npmVersion = "1.0.0";
protected String npmRepository = null;
protected String injectionToken = "InjectionToken";
protected String injectionToken = "InjectionToken<string>";

public TypeScriptAngular2ClientCodegen() {
super();
Expand All @@ -41,7 +41,8 @@ public TypeScriptAngular2ClientCodegen() {
embeddedTemplateDir = templateDir = "typescript-angular2";
modelTemplateFiles.put("model.mustache", ".ts");
apiTemplateFiles.put("api.mustache", ".ts");
typeMapping.put("Date","Date");
typeMapping.put("Date", "Date");
typeMapping.put("Array", "Array");
apiPackage = "api";
modelPackage = "model";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export class {{classname}} {{#parent}}extends models.{{{parent}}} {{/parent}}{
export class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{
{{#additionalPropertiesType}}
[key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InjectionToken } from '@angular/core';
import { InjectionToken<string> } from '@angular/core';

export const BASE_PATH = new InjectionToken('basePath');
export const BASE_PATH = new InjectionToken<string>('basePath');
export const COLLECTION_FORMATS = {
'csv': ',',
'tsv': ' ',
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/typescript-angular2/npm/variables.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InjectionToken } from '@angular/core';
import { InjectionToken<string> } from '@angular/core';

export const BASE_PATH = new InjectionToken('basePath');
export const BASE_PATH = new InjectionToken<string>('basePath');
export const COLLECTION_FORMATS = {
'csv': ',',
'tsv': ' ',
Expand Down

0 comments on commit 47794d8

Please sign in to comment.