Angular 8 면접 질문과 답변
Ques 31. Explain the purpose of zone.js in Angular.
Zone.js is a library that helps Angular with change detection. It provides a context for JavaScript execution and allows Angular to know when asynchronous operations, such as HTTP requests or timers, are completed. This knowledge triggers the change detection process.
Example:
import 'zone.js/dist/zone';
도움이 되었나요?
Add Comment
View Comments
Ques 32. What is the Angular TestBed used for in testing?
The TestBed in Angular testing is a configuration and testing utility that provides methods for configuring and creating testing modules. It is used to create a controlled environment for testing Angular components, services, and other constructs.
Example:
TestBed.configureTestingModule({
declarations: [AppComponent],
providers: [DataService],
});
도움이 되었나요?
Add Comment
View Comments
Most helpful rated by users: