Which method in the TestBed is used to create an instance of a component or service for testing?
- createComponent()
- createService()
- getComponent()
- getService()
In Angular, you use the createComponent() method provided by TestBed to create an instance of a component for testing. This method allows you to set up and configure the component in a controlled testing environment.
Loading...
Related Quiz
- The lifecycle hook ngAfterViewInit is specifically related to a component's child ________.
- Which tag is used for multi-slot content projection in Angular?
- How do you set default values for controls in a reactive form?
- How does Akita differ in its approach to state management compared to NgRx?
- You're creating a feedback form where users can rate a product. You want to ensure users provide a rating between 1 to 5. How would you validate the input to ensure values are within this range?