Hi David,

The polymer-file element is from the old deprecated set and I don't think
we're actively using it anywhere. Having said that, we are using other
similar elements like core-ajax and core-localstorage. One thing to keep in
mind is that you use similar elements all the time: <script> and <style>
both perform non-visual actions (handing scripts off to the JS engine or
CSS parser).

The power of core-ajax and core-localstorage does not become immediately
obvious until you factor in data binding. With data binding in play, these
elements become very easy to use data providers that require little to no
javascript to wire up. For example, here's an element that takes a search
term and lists all the YouTube videos that match that term using
databindings and core-ajax: http://jsbin.com/woteru/7/edit

Docs for core-ajax are here if you're interested:
http://www.polymer-project.org/docs/elements/core-elements.html#core-ajax

The nice thing is you don't have to use any of these elements if it doesn't
jive with how you'd like to build your app. In some cases they're a handy
tool and in other instances you may prefer to do it all in script. It's
entirely up to you :)

On Mon, Sep 15, 2014 at 12:47 PM, David James <[email protected]> wrote:

> I just looked over this nice presentation:
> http://html5-demos.appspot.com/static/polymer/index.html#24
>
> I have some questions about slide 24 "Everything is an element, read
> files...using DOM".
>
> Here is the code from the slide:
>
> <polymer-file readas="dataurl"></polymer-file>
> var pFile = document.querySelector('polymer-file');
> pFile.addEventListener('polymer-result', function(e) {
>   console.log(this.result);
> });
> pFile.blob = new Blob(['abc'], {type: 'text/plain'}); // Set the file to
> read
> pFile.read();
>
> This seems like madness; why use an *element* to read a file at all? Reading
> a file is fundamentally an action. Wrapping up an action in a structural
> element (intended for a UI) seems ill-conceived.
>
> Am I missing something? Perhaps polymer-file is *only*intended to
> represent a file upload UI component?
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/2ec8f0ed-4515-4749-9578-5750dab21a28%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/2ec8f0ed-4515-4749-9578-5750dab21a28%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAJj5OwAAAANpCT5U%2Be-0rrZRj1bHZfoGqFdJ3_xT7%2B8mhMMO8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to