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

Add support for base-href #64

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add support for base-href #64

wants to merge 3 commits into from

Conversation

yowari
Copy link

@yowari yowari commented Jun 12, 2018

#63
This is my idea of adding support for base-href. To do so:

  • I extracted the MonacoService from BaseEditor class, I think we should extract more code from this class
  • I use PlatformLocation to retrieve the baseHref, this should not be used but I didn't found other alternative. I couldn't inject APP_BASE_HREF I got an error:
StaticInjectorError(AppModule)[MonacoService -> InjectionToken appBaseHref]: 
StaticInjectorError(Platform: core)[MonacoService -> InjectionToken appBaseHref]: 
NullInjectorError: No provider for InjectionToken appBaseHref!

}

loadMonaco(): Promise<void> {
if (!loadedMonaco) {
loadedMonaco = true;
loadPromise = new Promise<void>((resolve: any) => {
const baseUrl = this.config.baseUrl || '/assets';
const baseUrl = this.config.baseUrl || Location.joinWithSlash(this.baseHref, '/assets');

Choose a reason for hiding this comment

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

Isn't it enough to replace /assets with ./assets? I got it running on github pages this way.

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