thewebplatform / x-carousel

touch carousel for x-tag
Apache License 2.0
0 stars 0 forks source link

Add data method for capturing item #3

Open Nevraeka opened 9 years ago

Nevraeka commented 9 years ago

Provide a method the is responsible for delegating to a url data fetch as an attribute or an explicit list declared as DOM nodes or local data

Nevraeka commented 9 years ago

@csuwildcat - What is the preferred way for x-tag?

csuwildcat commented 9 years ago

First off, you may want to glance over these docs - they're way more detailed than x-tags.org: https://x-tag.readme.io/v1.0/docs (we're just finishing up the last bits before we switch to ReadMe). I noticed you had some functions in your lifecycle that aren't lifecycle callbacks. Any methods you want to add go under the methods: {} object. The methods object is a top-level object under your main register object definition.

As for your question, are you asking if there's a built-in fetch mechanism for something like a script tag's src attribute?

Nevraeka commented 9 years ago

Sorry about that. I moved those methods and I'll go through the docs in further detail ASAP. As far as my question goes, My instinct is to have a custom accessor with a url value that the element can use to fetch a item list of data. I could also have a set of declarative list items or do something else.

Nevraeka commented 9 years ago

<x-carousel items="https://path/to/data_items"></x-carousel>

or/and


<x-carousel>
    <item name="first-item">item 1</item>
    <item name="second-item">item 2</item>
</x-carousel>
csuwildcat commented 9 years ago

So you want to use a url to do an async fetch of content, or something like datalist's child elements that it uses as the values for autocomplete?

csuwildcat commented 9 years ago

Datalist doc: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist

^ something like that?

Nevraeka commented 9 years ago

Whichever x-tag philosophy prefers but yes either the declarative approach (not <datalist> per se because of the usage) or the implicit approach ( fetch or other)