Now my question is: Is there any way to check if an API response is equal to the interface and throw an error if is not. I was expecting that if the response from the server didn't match the interface then the Angular would redirect to catchError. I created an interface to tell Typescript the data I expect. I have an app that when the user logs in he received some data as a response, but if the response is not what I expect, the app crashes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |