gwendall/way.js

self._bindings["__all__"] required?

Closed this issue · 1 comments

I’ve tested this on Chrome v36 on OS X 10.9 and Firefox v31 on OS X 10.9, and it seems that if I do not include an element bound to "__all__", I’ll get the error: Uncaught TypeError: Cannot read property 'forEach' of undefined where undefined here refers to self._bindings["__all__"]

To elaborate, this works fine:

<html>
<body>
  <form way-data="model" way-persistent="true">
    <input type="text" name="magic">
    <input type="radio" name="ultra" value="something something darkside">
    <input type="radio" name="ultra" value="something something brightside">
  </form>
  <div way-data="__all__" way-json="true"></div>

  <script src="way.bundle.js"></script>
</body>
</html>

But this will fail:

<html>
<body>
  <form way-data="model" way-persistent="true">
    <input type="text" name="magic">
    <input type="radio" name="ultra" value="something something darkside">
    <input type="radio" name="ultra" value="something something brightside">
  </form>
  <!-- <div way-data="__all__" way-json="true"></div> -->

  <script src="way.bundle.js"></script>
</body>
</html>

Fixed, thanks for spotting that!