Angular Expert — Series 2

Preview — 3 of 10 questions

An app runs with provideZonelessChangeDetection(). Which statement is true?

javascript
count.set(1);              // signal write — notifies
cdr.markForCheck();        // explicit
// async pipe emission, host listener, template event — all notify
AChange detection no longer exists; templates re-render on every frame
BOnly signals can update a view — async pipe bindings stop working
Czone.js no longer patches async APIs, so nothing schedules change detection implicitly. Angular relies on explicit notifications instead: signal writes, markForCheck, async pipe emissions, host listeners
DComponents must all be OnPush, or the app throws at bootstrap

What does calling tick() manually do?

AIt runs change detection synchronously over all dirty views, from the roots down — useful in tests and rare integrations, and a smell in application code
BIt re-renders every view, dirty or not, ignoring OnPush
CIt is a no-op without zone.js
DIt schedules a check for the next animation frame

A component injects a token provided in a route's providers. Which injector resolves it, and what happens if it is missing there?

AThe node injector only; route providers are node-level
BNeither — route providers are only visible to guards and resolvers
CThe root injector always, because route providers are merged into it at bootstrap
DThe lookup walks the node injector chain (the component's element and its ancestors' providers/viewProviders) and, when that is exhausted, continues into the environment injector chain — where route-level providers live, before the root environment injector

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.