[Angular 2] Injecting a Service

Using Services in Angular 2 is very simple. This lesson covers how to create a simple class as a Service then set it up so that you can use it across all your Components.

 

In the bootstrap() we can inject the service to the application. Then the service is available to the whole application. But what if we don't want to make it available to the whole application?

 

posted @ 2016-03-20 03:39  Zhentiw  阅读(155)  评论(0编辑  收藏  举报