30-seconds-of-angular icon indicating copy to clipboard operation
30-seconds-of-angular copied to clipboard

feat(snippet): web component in use

Open LironHazan opened this issue 5 years ago • 6 comments

LironHazan avatar Jun 16 '19 07:06 LironHazan

Hey Liron, thanks for the contribution! It would be great to mention that schemas: [CUSTOM_ELEMENTS_SCHEMA] has to be included in the module. Also would be great to have a warning saying that the type safety would be lost in terms of component names.

NothingEverHappens avatar Jun 26 '19 18:06 NothingEverHappens

@NothingEverHappens great, I'll mention the schemas required addition, but regarding the warning, I'm not sure I understand your comment, what do you mean by type safety? is it concerns to a typescript compiler issue recognising the custom element class type? or a name conflict in case there's an angular component with the same name of the custom element? sorry I tried to look out for more info but couldn't find something relevant so I'll appreciate if you'll give a short explanation and I'll make sure to add the warning :)

LironHazan avatar Jun 26 '19 19:06 LironHazan

Hey, Liron, I think it you have a <element-does-not-exist> used somewhere in the template, angular would display an error saying it can't find it.

However with CUSTOM_ELEMENTS_SCHEMA, my understanding is that no error would be shown? (unless I'm missing something?)

kirjs avatar Jul 07 '19 21:07 kirjs

@kirjs yeah, adding CUSTOM_ELEMENTS_SCHEMA allows an NgModule to contain the following: Non-Angular elements named with dash case (-). Element properties named with dash case (-). Dash case is the naming convention for custom elements. unless we'll get template parse errors, I'll add it to the PR

LironHazan avatar Jul 08 '19 09:07 LironHazan

@fetis mind review changes? :)

LironHazan avatar Jul 13 '19 07:07 LironHazan

@LironHazan This is good to merge, the demo seems to be working (you can check it out here: https://codelab.fun/30/new/30-seconds-of-angular/nycJSorg/189)

The only thing left - it would be awesome to simpilfy the demo a bit (throw away irrelevant stuff)

kirjs avatar Jul 15 '19 19:07 kirjs