30-seconds-of-angular
30-seconds-of-angular copied to clipboard
feat(snippet): web component in use
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 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 :)
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 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
@fetis mind review changes? :)
@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)