问题
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