人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

面接準備

Angular 面接の質問と回答

関連する比較

関連する比較

Jquery vs AngularJSAngularJS vs NodeJSAngularJS vs Angular
Angular vs React

質問 41. What is RxJS in Angular?

RxJS is a library for composing asynchronous and callback-based code in a functional, reactive style using Observables. Many APIs such as HttpClient produce and consume RxJS Observables and also uses operators for processing observables.

For example, you can import observables and operators for using HttpClient as below,

import { Observable, throwError } from 'rxjs';

import { catchError, retry } from 'rxjs/operators';

役に立ちましたか? コメントを追加 コメントを見る
 

質問 42. What is subscribing in Angular?

An Observable instance begins publishing values only when someone subscribes to it. So you need to subscribe by calling the subscribe() method of the instance, passing an observer object to receive the notifications.

Let's take an example of creating and subscribing to a simple observable, with an observer that logs the received message to the console.

Creates an observable sequence of 5 integers, starting from 1

const source = range(1, 5);

// Create observer object
const myObserver = {
  next: x => console.log('Observer got a next value: ' + x),
  error: err => console.error('Observer got an error: ' + err),
  complete: () => console.log('Observer got a complete notification'),
};

// Execute with the observer object and Prints out each item
source.subscribe(myObserver);
// => Observer got a next value: 1
// => Observer got a next value: 2
// => Observer got a next value: 3
// => Observer got a next value: 4
// => Observer got a next value: 5
// => Observer got a complete notification

役に立ちましたか? コメントを追加 コメントを見る
 

質問 43. What is an observable in Angular?

An Observable is a unique Object similar to a Promise that can help manage async code. Observables are not part of the JavaScript language so we need to rely on a popular Observable library called RxJS. The observables are created using new keyword.

Let see the simple example of observable,

import { Observable } from 'rxjs';

const observable = new Observable(observer => {
  setTimeout(() => {
    observer.next('Hello from a Observable!');
  }, 2000);
});

役に立ちましたか? コメントを追加 コメントを見る
 

質問 44. What is an observer in Angular?

Observer is an interface for a consumer of push-based notifications delivered by an Observable. It has below structure,

interface Observer<T> {
  closed?: boolean;
  next: (value: T) => void;
  error: (err: any) => void;
  complete: () => void;
}

A handler that implements the Observer interface for receiving observable notifications will be passed as a parameter for observable as below,

myObservable.subscribe(myObserver);


Note: If you don't supply a handler for a notification type, the observer ignores notifications of that type.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 45. What is the difference between promise and observable?

ObservablePromise
Declarative: Computation does not start until subscription so that they can be run whenever you need the resultExecute immediately on creation
Provide multiple values over timeProvide only one
Subscribe method is used for error handling which makes centralized and predictable error handlingPush errors to the child promises
Provides chaining and subscription to handle complex applicationsUses only .then() clause

役に立ちましたか? コメントを追加 コメントを見る
 

ユーザー評価で最も役立つ内容:

著作権 © 2026、WithoutBook。