swagger-api/swagger-codegen

Angular 1 gen - Add basePath to inject and allow empty basepath

Open

#2.788 geöffnet am 6. Mai 2016

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)HTML (5.474 Forks)batch import
Client: TypeScriptEnhancement: Generalhelp wanted

Repository-Metriken

Stars
 (12.701 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Add basePath to the inject array. In order to be able to use angular DI with a different basepath.

If base path is not present in inject array angular DI cannot resolve basePath when uglified.

Check for if(basePath !== undefined) instead of if(basepath) to allow an empty basePath

An empty basepath is handy when the API resides on the same host as the application

static $inject: string[] = ['$http', '$httpParamSerializer','basePath'];

constructor(protected $http: ng.IHttpService, protected $httpParamSerializer?: (d: any) => any, basePath?: string) { if (basePath !== undefined) { this.basePath = basePath; } }

Contributor Guide