New 2 Flashcards

1
Q

embedded styles takes precedence over any CSS styles except . . .

A

styles that are marked with !important

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a methodology for systematically organizing our styles

A

SMACSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

allows us to ship our components knowing that the styles of the component will (most likely) not be overridden by other styles in target applications

A

style isolation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

each component will have a unique host property attached. . . when?

A

upon application startup (or at build-time with AOT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how Angular provides the isolated styles

A

will then inject the styles directly into the page header as a style tag

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how can you style the host of the component you’re in?

A

the special :host pseudo-class selector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

if we want our component styles to cascade to all child elements of a component, but not to any other element on the page

A

:host /deep/ h2 {
color: red;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

allow a component to apply a style to elements outside of it

A

the :host-context selector

(one use case - theme classes)

  :host-context(.red-theme) .btn-theme {
    background: red;
  }
  :host-context(.blue-theme) .btn-theme {
      background: blue;
  }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CSS variable in Sass

A

$border-color: red;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Sass lets you make a reference to the parent style . . .

A

using the & syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

sometimes we want global styles, that are applied to all elements of a page

A

we can add those to our angular-cli.json config

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

pattern for separation of components into . . .

A

Container Components vs Presentational Components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Container Components

A

These components know how to retrieve data from the service layer. Note that the top-level component of a route is usually a Container Component

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Presentational Components

A

These components simply take data as input and know how to display it on the screen. They also can emit custom events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

one way to prevent multiple requests to the backend on an observable

A

using publishLast().refCount()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

with a large component tree, try to avoid

A

custom event bubbling

17
Q

The use of the async pipe will ensure . . .

A

. . . that the component will be re-rendered when a new version of the first name is emitted (for example when the user logs in), even if the component has no inputs

18
Q

the async pipe will detect that a new value was emitted by the observable and so it . . .

A

will then mark the component for re-rendering