Components inside components ?

248 views
Skip to first unread message

Christophe Serafin

unread,
Jul 9, 2013, 5:38:47 AM7/9/13
to polym...@googlegroups.com
Hi guys,

I am currently developing a web application using AngularJS which interface should be composed of various web components. 
Polymer looks really promising as you can create and use your own components !

As I also want to provide extensible interface, I would be very interesting in adding dynamic components to a custom component. Let's say you created your own component, you want to run another component inside to add a new feature, or a button that link to a new feature.

Does Polymer provide something that should be useful in these cases ? Maybe it would be interesting for someone else if it does not exists for the moment ?

Thanks for your feedback,

t00f

Alex Komoroske

unread,
Jul 9, 2013, 10:48:24 AM7/9/13
to Christophe Serafin, polym...@googlegroups.com
On Tue, Jul 9, 2013 at 2:38 AM, Christophe Serafin <christoph...@gmail.com> wrote:
Hi guys,

I am currently developing a web application using AngularJS which interface should be composed of various web components. 
Polymer looks really promising as you can create and use your own components !

:-) 

As I also want to provide extensible interface, I would be very interesting in adding dynamic components to a custom component. Let's say you created your own component, you want to run another component inside to add a new feature, or a button that link to a new feature.

Does Polymer provide something that should be useful in these cases ? Maybe it would be interesting for someone else if it does not exists for the moment ?

If I'm understanding you correctly, this should just work today. Custom elements are just normal elements--you can nest them as deep as you want. 

Thanks for your feedback,

t00f

--
 
---
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 polymer-dev...@googlegroups.com.
Visit this group at http://groups.google.com/group/polymer-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/c1d85d33-3a90-4cd6-8d99-3020f2105e36%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christophe Serafin

unread,
Jul 10, 2013, 4:37:46 AM7/10/13
to polym...@googlegroups.com, Christophe Serafin
Thanks for you quick reply. 

Watching your video introduction at Google IO and the answer was at 15' with your g-ratings element :-)
I will try to think about using Polymer in our modular interface architecture and will let you know...

Christophe Serafin

unread,
Jul 10, 2013, 8:24:14 AM7/10/13
to polym...@googlegroups.com, Christophe Serafin
Hey,

Creating components that contain other components is really easy but I would have a very tricky question :

Imagine you want your custom component behavior being controlled by an AngularJS controller ; in order to get information from a web server for instance. 

I would first try to write something like :

<element name="mouse-action">
   
<template>


       
<span ng-controller="MouseActionController">I'm <b>mouse-action</b>.
           
<!-- modules should come from MouseActionController scope -->
            Looging for modules {{modules}} :
       
</span>
   
</template>
   
<script>
   
Polymer.register(this);
   
</script>
</element>


AngularJS ng-controller directive is unknown and the controller is never called. I would say that it is a Shadow DOM side effect.
Have you already tried a such AngularJS / Polymer.js interaction ?

Eric Bidelman

unread,
Jul 11, 2013, 4:48:05 PM7/11/13
to Christophe Serafin, polymer-dev
Hey Chris,

I'm not an Angular expert. You might want ask this over in their group...

I've gotten Angular to work alongside web components, but using it inside will be tricky atm. You're likely correct that it's a Shadow DOM issue. The compiler can't see the ng-controller inside the element. 

One idea: can you move/share some of the logic of MouseActionController as methods on your element? 





Reply all
Reply to author
Forward
0 new messages