javascript - HashLocationStrategy on Angular2 beta 7 -
i want know how handle hashlocationstrategy angular2 beta 7? code beta 3 not work anymore.
what have:
import {bootstrap} 'angular2/platform/browser'; import {component, provide} 'angular2/core'; import {app_base_href, router_providers, locationstrategy, hashlocationstrategy} 'angular2/router'; import {appcomponent} './app.component'; bootstrap(appcomponent, [ router_providers, provide(locationstrategy, {useclass: hashlocationstrategy}) ]);
and error set base tag. hashlocationstrategy did not require base tag.
exception: error during instantiation of locationstrategy! (routerlink -> router -> location -> locationstrategy).browserdomadapter.logerror @ angular2.dev.js:23083browserdomadapter.loggroup @ angular2.dev.js:23094exceptionhandler.call @ angular2.dev.js:1185(anonymous function) @ angular2.dev.js:12591ngzone._notifyonerror @ angular2.dev.js:13635collection_1.stringmapwrapper.merge.onerror @ angular2.dev.js:13539zone.run @ angular2-polyfills.js:1247(anonymous function) @ angular2.dev.js:13558zoneboundfn @ angular2-polyfills.js:1220lib$es6$promise$$internal$$trycatch @ angular2-polyfills.js:468lib$es6$promise$$internal$$invokecallback @ angular2-polyfills.js:480lib$es6$promise$$internal$$publish @ angular2-polyfills.js:451(anonymous function) @ angular2-polyfills.js:123microtask @ angular2.dev.js:13590zone.run @ angular2-polyfills.js:1243(anonymous function) @ angular2.dev.js:13558zoneboundfn @ angular2-polyfills.js:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js:262 angular2.dev.js:23083 original exception: no base href set. please provide value app_base_href token or add base element document.
how hashlocationstrategy working in beta 7?
regards
original exception: no base href set. please provide value app_base_href token or add base element document.
add
<base href='/'>
to markup.
Comments
Post a Comment