Comments (2)
@Jimgskoop I am starting to heavily consider folding Loader into Container as well. The reason is this.
Lets say you have a carousel with 5 items. In this Carousel the first two items have static content and are stateful - SO, they should be managed by Container.
But what if the remaining items have dynamic content? - This should obviously be managed by Loader. But, does this also mean that we have two separate client-side templates for Container and Loader? They would be virtually identical.
I'd rather do something like this:
{#items}
{@if cond="{idx} < 3}
{>item content="Lorem Ipsum"}
{else}
{>item uri="http://www.google.com#node"}
{/else}
{/if}
{/items}
Where item has a config that looks something like:
{
'Container': {
{?url}'url': {url} {/url}
{?content}'content': {content} {/content}
}
}
We could do the same type of logic and still keep Loader and container separate but it gets nasty:
{
{?url}'Loader'{url} {/url} {?content}'Container'{content} {/content}: {
{?url}'url': {url} {/url}
{?content}'content': {content} {/content}
}
What if both url and content are defined? -- You'd have to introduce more logic into the template to make sure that's not the case. - This is better done in the control.
from lu.
That sounds OK to me. Container already knows how to source content
from elsewhere in the DOM; Loader just adds on the XHR and iframe
smarts.
My thinking was that any URL supercedes any local source if both are
present, but admittedly that's not ideal.
The only caveat is that you'll probably need distinct config params
for string, node, and URL for the source, in case you want to do
something like inject a URL as a string to display.
-Jim G
On Apr 14, 2012, at 11:14 AM, Robert Martone <[email protected]
wrote:
@Jimgskoop I am starting to heavily consider folding Loader into
Container as well. The reason is this.Lets say you have a carousel with 5 items. In this Carousel the
first two items have static content and are stateful - SO, they
should be managed by Container.But what if the remaining items have dynamic content? - This should
obviously be managed by Loader. But, does this also mean that we
have two separate client-side templates for Container and Loader?
They would be virtually identical.I'd rather do something like this:
{#items} {@if cond="{idx} < 3} {>item content="Lorem Ipsum"} {else} {>item uri="http://www.google.com#node"} {/else} {/if} {/items}
Where item has a config that looks something like:
{ 'Container': { {?url}'url': {url} {/url} {?content}'content': {content} {/content} } }
We could do the same type of logic and still keep Loader and
container separate but it gets nasty:{ {?url}'Loader'{url} {/url} {?content}'Container'{content} {/ content}: { {?url}'url': {url} {/url} {?content}'content': {content} {/content} }
What if both url and content are defined? -- You'd have to introduce
more logic into the template to make sure that's not the case. -
This is better done in the control.
Reply to this email directly or view it on GitHub:
https://github.com/Iheartweb/Lu/issues/70#issuecomment-5133289
from lu.
Related Issues (20)
- Write an architectural primer
- Write mappers primer
- Container example doesn't work HOT 1
- Load Button does not work HOT 1
- Keybindings for multiple components? HOT 2
- Write event tests for Switch
- Write Unit tests for Button
- Write Unit Tests for Container HOT 1
- Lists selected event fires twice
- Prevent Default & Buttons HOT 6
- States that overlap with ARIA states should apply the associated aria attribute
- Transient Unit Tests Failures for Switch and Abstract HOT 1
- Drawer HOT 3
- Sequence
- hoverIntent
- dependancies-resolved out of order
- Respect the hash stack HOT 1
- Mapper.js vanished? HOT 2
- Object Literal as Event-Trigger Payload HOT 1
- Add a destroy method to garbage collect events in Lu core
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lu.