[AngularJS] Re: Reusable Angular components which can be used any platform or technology
Hi Naga, I think in your case, the custom elements, in combination with template strings (or even template files you ajax in) are the way to go. You can set up your CE's so they work well in combination with Angular. Make sure you use getters/setters for proerties, to make sure they work well with angular. If you want, you can even let them mimic @input/@output behaviour. Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
[AngularJS] Re: Reusable Angular components which can be used any platform or technology
The current problem with custom elements is browser support (Chrome only, rest needs polyfills) Web components isn't really a thing. And yes, you sample shows a custom element. Template strings may come in handy if you go for using CE. If you find a better solution, please share it with us. Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
[AngularJS] Re: Reusable Angular components which can be used any platform or technology
Thanks Sander for the help Yes, I am facing integration issues with polymer webcomponent with Angular2. Custom elements that you are referring, is it native javascript web componets as below class HelloElement extends HTMLElement { // Monitor the 'name' attribute for changes. static get observedAttributes() {return ['name']; } // Respond to attribute changes. attributeChangedCallback(attr, oldValue, newValue) { if (attr == 'name') { this.textContent = `Hello, ${newValue}`; } }} // Define the new element customElements.define('hello-element', HelloElement); Currently trying with native HTML, javascript, CSS, as I gave up using polymer with Angular 2 for now. And also exploring other options for webcomponents just to create reusable HTML templates On Thursday, June 8, 2017 at 1:46:25 AM UTC-5, Sander Elias wrote: > > Hi, > > For now, I would use Custom Elements, with a couple of polyfills. I would > not use polymer. While I like polymer on its own, it has its own set of > issues. In most cases Polymer and Angular work quite well along with each > other, but there are more edge-cases as you might expect. Solving those > turns out to be not as easy. > > Be aware, that there are known flaws in those polyfills. Not big one's but > in highly specialised cases those might bite. > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
[AngularJS] Re: Reusable Angular components which can be used any platform or technology
Hi, For now, I would use Custom Elements, with a couple of polyfills. I would not use polymer. While I like polymer on its own, it has its own set of issues. In most cases Polymer and Angular work quite well along with each other, but there are more edge-cases as you might expect. Solving those turns out to be not as easy. Be aware, that there are known flaws in those polyfills. Not big one's but in highly specialised cases those might bite. Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
[AngularJS] Re: Reusable Angular components which can be used any platform or technology
Thanks Sander for the reply I would you love see that which makes Angular more powerful and stronger. And I was even trying opttions of webcomponents through polymer but started learning polymer. Is Polymer compatible with Angular2 easily? >From online , I could see limited documentation and outdated fiddle and plunker examples due to different versions of plunker Hoping to see those changes soon :) On Wednesday, June 7, 2017 at 11:32:51 PM UTC-5, Sander Elias wrote: > > Hi Naga, > > At the moment, it can be done, but you need to jump through hoops, and > it's very complex to do. However, not all is lost, there are things in the > pipeline that will make this easier. If everything I heard of comes to > life, it will become really *really *easy, so keep your fingers crossed. > (sorry, can't go into details, I don't want to reveal things that are not > mine to reveal, or might turn out not possible for whatever reason) > BTW, most of this is mid to long term, so don't expect to see any of this > in the next 6 months, por perhaps even longer! > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
[AngularJS] Re: Reusable Angular components which can be used any platform or technology
Hi Naga, At the moment, it can be done, but you need to jump through hoops, and it's very complex to do. However, not all is lost, there are things in the pipeline that will make this easier. If everything I heard of comes to life, it will become really *really *easy, so keep your fingers crossed. (sorry, can't go into details, I don't want to reveal things that are not mine to reveal, or might turn out not possible for whatever reason) BTW, most of this is mid to long term, so don't expect to see any of this in the next 6 months, por perhaps even longer! Regards Sander -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.