-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
consider adding templating #357
Comments
Yeah, the current way definitely isn't the most optimal. In this specific case it might be cleaner to just build a span for the time specifically and reference the innerHTML of that instead of overwriting the whole content el. On Mar 4, 2013, at 3:34 PM, Gary Katsevman notifications@github.com wrote:
|
To clarify this more, every component has a contentEl property that returns the el() by default, but you can have them be different, for instance if you want children to be embedded in a sub-element of the component's main element. In this specific case we could set up the span as a contentEl, so we don't have to create a new element each time. But there still use for templates other places. If we can decide on how to pull in lodash we could make use of those templates. This could probably be broken up into two feature issue, but confirming this either way. |
Just to revisit this one, if we're going to use an ES6 transpiler (#1812), this is somewhat moot. Even something as simple as string substition would improve things. |
I think we can consider this closed now that we have things like #2015 pulled in. |
There is probably some extra stuff we can do to increase DRY, but yeah, we did get a lot of stuff for this via template strings. |
Seems like there is a lot of string manipulation going on in the creation of the controls. Would be nicer if we were to use a templating system.
Even one as simple as:
For example, we currently have the same string in the
content
andupdateContent
of thedurationDisplay
.Instead, each component, could have a template associated with it that can be changed.
The text was updated successfully, but these errors were encountered: