Angular 2 Tutorial [6] - Creating A Service

preview_player
Показать описание

In this video I will show you how to create a service in Angular 2 and inject it as a dependency
Рекомендации по теме
Комментарии
Автор

Reserve the constructor for simple initialization such as wiring constructor parameters to properties. The constructor shouldn't do anything. It certainly shouldn't call a function that makes HTTP requests to a remote server as a real data service would.

CroGmaz
Автор

remember abba's song, "the winner takes it all". steve dux takes it all.

spicytuna
Автор

There are really two different functions: addPost and inside a second function with the same name, right?

dominaiter
Автор

Hi guys, I, m having all sorts of problems with this Tutorial, mainly private posts comes up as an error all the time. Using the latest version of Angular 2, changed the imports to @angular/core etc, also have tried building with the Cli method as well, can't get ngFor to work, any help would be deeply appreciated. Been ongoing for 2 weeks now, help !!!

georgewilliamson