Components, DI, RxJS, and the Angular interview essentials.
Preview — first 3 of 122 cards
What is an Angular component?
A class decorated with @Component combining a template, styles, and logic. Standalone components (v15+) declare their own imports and need no NgModule.
@Component({ selector: 'app-x', standalone: true, template: `<p>{{title}}</p>` })
export class X { title = 'Hi'; }
Component metadata properties?
selector, template/templateUrl, styles/styleUrls, imports, providers, changeDetection, encapsulation, host. selector defines the custom element name.
@Component({ selector: 'app-card', templateUrl: './card.html' })
ngOnInit vs constructor?
Constructor is for DI; inject() is fine for wiring signals and computed values. Avoid heavy side effects/async work; use ngOnInit for input-dependent init.
private http = inject(HttpClient);
count = signal(0);
doubled = computed(() => this.count() * 2);
119 more cards in this sheet
Unlock the Frontend & Mobile bundle — ₹399
One-time payment. Unlocks this sheet and 8 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.