Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple args in binders #382

Closed
artemsvirskyi opened this issue Sep 24, 2014 · 1 comment
Closed

Multiple args in binders #382

artemsvirskyi opened this issue Sep 24, 2014 · 1 comment
Milestone

Comments

@artemsvirskyi
Copy link
Contributor

Now there is no possibility to use multiple args in binders. Like rivets.binders['*-on-*']. So foo-on-bar binder wouldn't fit this template.

http://jsfiddle.net/8Lw618or/3/

That's because of replace method. If its first parameter is a string, then it replaces only first occurrence.

'aa'.replace('a', 'b'); // "ba"

So we need regex here with g flag.

'aa'.replace(/a/g, 'b'); // "bb"

Working example: http://jsfiddle.net/8Lw618or/4/

@jhnns
Copy link
Contributor

jhnns commented Oct 22, 2014

Nice 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants