Open pengkobe opened 6 years ago
angular/core 包括哪些内容呢?看下源码下 core 目录下的文件
看上去内容有点多,我们列下重点内容
你可以这么用
const componentInjector = Injector.create([], this.injector);
this.componentFactory = this.injector.get(ComponentFactoryResolver) .resolveComponentFactory(this.component); this.componentRef = this.componentFactory.create(componentInjector, null, element);
EventEmitter
this.changeDetectorRef.detectChanges();
angular/core 包括哪些内容呢?看下源码下 core 目录下的文件
看上去内容有点多,我们列下重点内容
注入器 Injector
你可以这么用
组件工厂 ComponentFactory
事件发射器
EventEmitter
ChangeDetectorRef
反射( reflect ) 与依赖注入( di )
渲染器( render )
解析器( compile )
变化检测( change_detection )
其它