Angular2 RC5 Fusion Charts with routing not working because of base href tag

牧云@^-^@ 提交于 2019-12-11 04:33:39

问题


I am using Angular2 rc5 with routing, So in index.html I wrote

document.write('<base href="' + document.location + '" />')

I am using fusion charts in my app.

I have 2 charts in following url in components

/fusion1 chart here works properly default url for app

and when I click on link the url becomes now

/fusion2 here chart won't render properly it displays labels but wont render palette colors.

If we see fill url in svg it displays like this

fill=url('localhost:8443/fusion1#588xr___120_278_216__rgba_0_174_141_1_:0-rgba_0_174_141_1_:100')

My fill url is not taking updated route url which has to take

localhost:8443/fusion2

any help will be appreciated.


回答1:


Provide APP_BASE_HREF instead of the <base> tag to configure the router, then you can set <base href="..."> independent of the router.

providers: [{provide: APP_BASE_HREF, useValue: '/'}]

See also Angular 2 router no base href set



来源:https://stackoverflow.com/questions/39229027/angular2-rc5-fusion-charts-with-routing-not-working-because-of-base-href-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!