SAP Spartacus PR 10507第二次尝试
- move this.requiredtabindex = -1 into ngAfterViewInit, due to two reasons:
a. before change: In the context of requiresExplicitTabIndex execution, tag does not have href attribute populated yet. For detail see this discussion thread
as a result, we have to put it to ngOnAfterViewInit, at that time the href attribute of a tag is already populated with correct value:
b. The problem here is that we have a situation where the view generation process (which ngAfterViewInit is a part of) is itself further modifying the data that we are trying to display in the first place.
In unit test code it reports error message:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: ‘undefined’. Current value: ‘-1’.
See this blog.
So I use setTimeout() to defer the code to another Javascript Virtual Machine turn.
- Since now this.requiredtabindex = -1 is wrapped to setTimeout and executed asynchronously, some unit test will fail:
- how to use this extended attribute in units-detail.component.html?
更多Jerry的原创文章,尽在:“汪子熙”:
本文同步分享在 博客“汪子熙”(CSDN)。
如有侵权,请联系 [email protected] 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。
- Cockroach Labs scores $86.6M Series D as scalable database resonates
- Figma raises $50 million Series D led by Andreessen Horowitz
- 翱捷科技完成1.19亿美元D 轮融资
- R&D Roundup: Sweat power, Earth imaging, testing ‘ghostdrivers’
- Interfacing D with C: Arrays and Functions (Arrays Part 2)
- Better C – A subset of D Programming Language
- D-Cube: Dense-Block Detection in Terabyte-Scale Tensors 阅读笔记
- Insta360完成数千万美元D轮融资 诺辉健康完成2000万美元D轮融资 CoutLoot完成A轮融资
- 华为 ADS 获ASIL D 认证,新生意是打包自动驾驶解决方案卖给车企?
- 肿瘤居家早筛蓄势待发,「诺辉健康」完成2000万美元D轮融资