源代码:
fixture的类型是component-fixture,里面会调用_tick方法:
具体执行的detectChange逻辑,取决于Change Detect reference:
RootViewRef,执行view方面的change detect:
class RootViewRef extends ViewRef {
constructor(_view) {
super(_view);
this._view = _view;
}
detectChanges() {
detectChangesInRootView(this._view);
}
checkNoChanges() {
checkNoChangesInRootView(this._view);
}
get context() {
return null;
}
}
tickRootContext里要执行RenderComponentOrTemplate:
最后进入RefreshView的执行:
更多Jerry的原创文章,尽在:“汪子熙”: