gwendall/way.js

Doesn't work while loading a template via EJS

Opened this issue · 2 comments

Hi. The lib seems to work pretty wellbut I can't make it work when I load a template and put on the DOM

Reading the documentation, seems I need to call
way.registerBindings();

after load the HTML into the DIV

If I check the attributes in the console, all the attributes way-readonly="false", ... seems to be well configured but the divs are not automatically updated on the DOM changes.

If I put the HTML with no templates and I didn't use the registerBindings all seems to work well.

It's anything else needed to make this lib works after injecting HTML into a DIV?

Kind regards

I just discovered a few of interesenting points:
Library doesn't work well with requirejs
Loading the script with the

  • with script src="/js/vendor/way.min.js" works well
  • with script data-main="/js/main.js" src="js/require.js doesn't

I mean, the library works (I can made a console.log) but didn't track any changes

Library loaded with the tradicional way doesn't work well with HTML injected
If I load the library the first way all changes are tracked automatically but If I inserted the HTML via ajax don't

In both cases I made test adding and removing way.registerBindings(); after inject the HTML code

Regards!

when the dialog content is load from ajax, how to binding the form with json vars?