CRUD in Angular2 with Restful API

Download angular2 eBook

Syntax

  • @Injectable() // Tells dependency injector to inject dependencies when creating instance of this service.

  • request.subscribe() // This is where you actually make the request. Without this your request won't be sent. Also you want to read response in the callback function.

  • constructor(private wikiService: WikipediaService) { } // Since both our service and it's dependencies are injectable by the dependency injector it's a good practice to inject the service to component for unit testing the app.

Related Examples

Stats

520 Contributors: 2
Sunday, October 9, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook