Bridger Zoske

Q&A

Answers

  • December 19, 2019 at 8:57 PM
  • Visible to group members and anyone with the link
* What is the difference between a property and an attribute?
Properties can be of any type, attributes are always strings. An object's properties can be directly read by other objects.
* Which one would you use to pass a large complex object into the component?
The best way to pass large complex objects to components is with properties.
* Inside a component event handler, what does this refer to?
this refers to the component itself. 
* Which Custom event flags need to be set (if any) for an event to cross the Shadow DOM boundary?
the event flags composed and bubbles need to be set to true
* List 2 lifecycle methods that LitElement inherits from Custom Web Components.
connectedCallback: Invoked when a component is added to the document’s DOM.
disconnectedCallback: Invoked when a component is removed from the document’s DOM.
* list 3 ways to provide CSS styles to our Web Components
static styles property.
inline styling
external stylesheets
* Does the CSS cascade extend beyond the Shadow Root?
styles inside of a shadow DOM node don’t leak outside of the shadow root and styles from outside the shadow root don’t leak in
* Provide 1 or 2 ways you can pass CSS styles across the shadow root?
using :host