kittencup / angular2-ama-cn

angular2 随便问
692 stars 101 forks source link

要使用 http,form 为什么需要在bootstrap(...)启动服务 #191

Open CK110 opened 8 years ago

CK110 commented 8 years ago

为什么 像http,form 我要先提供provider image 或者 image

才能在其他地方使用 image

它并不像 import { Component } from '@angular/core'; 这样直接在页面用,也没见这个有什么providers?

Component ,http ,form 之间有什么不同吗?

kittencup commented 8 years ago

provider 只是把该Class注册到di里,后面都是从di里取, 而有些核心的东西,可能angular2已帮你注册到di里了