Jasdeep Khalsa
1 min readMay 16, 2017

--

This would definitely work, but seems a little dangerous to be modifying an external library’s (RxJS) prototype. In the future this would also become a native JavaScript object, so again modifying it like this is probably not a future-proof approach.

I would prefer to handle data fetching within a component dedicated to data fetching and parsing and using the built in json pipe operator or a custom pipe to transform it into JSON.

An example of this can be found within the angular.io docs: https://angular.io/docs/ts/latest/guide/pipes.html (towards the bottom of the page)

--

--