Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS injection and baseUrl fixes #2204

Merged
merged 3 commits into from Jun 6, 2019

Conversation

alexdresko
Copy link
Contributor

  • Allows ConfigurationClass to be injected.

    If a configuration class is specified, it has to be added to the inject list. Otherwise, Aurelia's DI will pass an empty string for the configuration class instance. For that matter, I'm really not sure how/why you'd want to inject a string with DI.

  • Handles empty baseUrl

    The string that is injected into the client is always empty... so the check I added here allows the base class to configure the base URL.

* Allows ConfigurationClass to be injected.
* Handles empty baseUrl
@@ -22,7 +22,7 @@
{% endif -%}
this.http = http ? http : <any>window;
{% if UseGetBaseUrlMethod -%}
this.baseUrl = baseUrl ? baseUrl : this.getBaseUrl("{{ BaseUrl }}");
this.baseUrl = baseUrl && baseUrl != "" ? baseUrl : this.getBaseUrl("{{ BaseUrl }}");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!==?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@RicoSuter
Copy link
Owner

Thanks for the PR. Is the PR ready now?

@alexdresko
Copy link
Contributor Author

Happy to help. PR seems ready. I'm using the code here and it works great.

@RicoSuter RicoSuter merged commit 63ce556 into RicoSuter:master Jun 6, 2019
@alexdresko alexdresko deleted the fix-configuration-injection branch June 11, 2019 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants