ubs121
ubs121

Reputation: 1

Single page app with web component

I'm writing a web-based project using polymer.dart. When I use anchor elements inside a web component, it always redirects to the URL prefixed with component name which is not exists. Do I need to add routing logic in every web component and prevent this default behavior ? Or is there any other solution ?

Upvotes: 0

Views: 358

Answers (1)

ebidel
ebidel

Reputation: 24109

Generally, yes...or use a framework that does this sort of thing. This is not a problem web components tries to solve. A link (anywhere) in your will need to have preventDefault() called, otherwise the browser will invoke its default behavior. In the case of a link, that's to navigate to the target.

Upvotes: 1

Related Questions