3 ms·
Entirely agreed, this is what I was about to say as well. Being able to use html templates for me makes apps much less confusing and much more organized. Moving
by jenius 13y ago
Entirely agreed, this is what I was about to say as well. Being able to use html templates for me makes apps much less confusing and much more organized. Moving your html into your javascript just doesn't seem right. If there was a way that it would accept a mustache/underscore/other precompiled template I'd be all about it. But constructing html out of javascript functions and objects just doesn't sit right with me.
- hamburglar 13y agoI actually had the same thought, but I also get that some people don't like HTML-based templates for various reasons. My next thought was whether or not you could just augment this framework by providing a utility that converts an HTML-based template into the view that mithril expects and make both camps happy. As an optional contrib module, of course -- I'm not suggesting he start heaping on additional framework features already. :) edit: I just wanted to add that I read through the guide expecting to find yet another half-baked framework but the whole thing seems well thought out and I like the philosophy alluded to in the guide. I'm definitely going to try this for my next mini-project.
- abjorn 13y agoWell, there is such a tool, actually. http://lhorie.github.io/mithril/tools/template-converter.html http://lhorie.github.io/mithril/tools/template-converter.htm... But while me and my coworker have been trying it out there seem to be quite a few bugs with it, and I'd much rather have it done at runtime (precompiled for production build) then have to translate it from my HTML-based template every time I make a change.
- lhorie 13y agoCan you file an issue on Github? I still need to make an automated version of this tool (and eventually be able to import from something like Mustache), and I want to make sure it's rock solid.
- hamburglar 13y agoWell, that's a good start, but I was referring to a 'utility' in the sense of a utility method that does it at runtime, as you say.
- SNACKeR99 13y agoDefinitely, and there are other benefits in parallelizing the work stream if you have people that do layout and styling, but aren't necessarily up to constructing a page in a javascript framework.
- Xdes 13y ago>converts an HTML-based template into the view that mithril expects So basically XAML?