Angular find which services are required to the component, by looking at the "type" of components ________ parameters.
Answers
Answered by
2
Classes, factories and values
Answered by
0
Answer:
Angular
Step-by-step explanation:
Angular takes the list of classes in the “providers” array and creates a simple registry used to retrieve the class. But there’s a slight twist to make things more flexible. A key reason why a “twist” is needed is to help us write unit tests for our components that have providers we don’t want to use in the testing environment. In the case of MyClass, there isn’t much reason not to use the real thing, but if MyClass made a call to a server to retrieve data, we might not want to or be able to do that in the test environment. To get around this, we need to be able to substitute within ProvDemo a mock MyClass that doesn’t make the server call
Similar questions
Psychology,
7 months ago
English,
7 months ago
English,
7 months ago
Social Sciences,
1 year ago
History,
1 year ago
Computer Science,
1 year ago