Самые популярные вопросы и ответы для интервью и онлайн-тесты
Образовательная платформа для подготовки к интервью, онлайн-тестов, учебных материалов и живой практики

Развивайте навыки с целевыми маршрутами обучения, пробными тестами и контентом для подготовки к интервью.

WithoutBook объединяет вопросы для интервью по предметам, онлайн-практику, учебные материалы и сравнительные руководства в одном удобном учебном пространстве.

Подготовка к интервью

Angular 8 вопросы и ответы для интервью

Вопрос 6. Explain dependency injection in Angular.

Dependency injection is a design pattern in which a class receives its dependencies from external sources rather than creating them itself. In Angular, the DI system provides and injects the dependencies into the components, services, etc.

Example:

constructor(private dataService: DataService) { }

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 7. What is a service in Angular?

In Angular, a service is a singleton object that performs tasks like fetching data, sharing data between components, or encapsulating business logic. Services are used to promote reusability and maintainability.

Example:

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class DataService { }

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 8. Explain Angular directives.

Directives in Angular are markers on DOM elements that tell Angular to attach behavior to a DOM element or transform the DOM element and its children. Examples include ngIf, ngFor, and ngStyle.

Example:

This is visible

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 9. What is the purpose of ngOnInit() in Angular?

ngOnInit is a lifecycle hook in Angular that is called after Angular has initialized all data-bound properties of a directive. It is a good place to put initialization logic for your component.

Example:

ngOnInit() {
  // Initialization code here
}

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 10. What is Angular CLI?

Angular CLI (Command Line Interface) is a powerful tool for initializing, developing, scaffolding, and maintaining Angular applications. It provides commands for tasks like generating components, services, and modules.

Example:

ng generate component my-component

Это полезно? Добавить комментарий Посмотреть комментарии
 

Самое полезное по оценкам пользователей:

Авторские права © 2026, WithoutBook.