gwendall / way.js

Simple, lightweight, persistent two-way databinding
2.87k stars 254 forks source link

Can I binding data to a.href or other attribute #62

Open wangkerui opened 9 years ago

wangkerui commented 9 years ago

How can I replace text 'link-url' by data-binding?

way.set("link-text", "this is a link");
way.set("link-url", "http://this.is.a.url/");
<a href="link-url" way-data="link-text"></a>

I expects:

<a href="http://this.is.a.url" way-data="link-text">this is a link</a>

but actually it renders

<a href="link-url" way-data="link-text">this is a link</a>
wangkerui commented 9 years ago

see https://github.com/wangkerui/way.js/commit/c9caea826dbabd8bbb58dc53ea0636d7ad1cd7d6