0

当我尝试为fixture.debugElement.nativeElement它的属性分配一个值时,我会出错。

fixture.debugElement.nativeElement.clientWidth = 4501;

我检查了调试器并fixture.debugElement.nativeElement.clientWidth存在,它不存在undefinednull

铬午餐错误

TypeError: Cannot assign to read only property 'clientWidth' of object '[object HTMLDivElement]'
        at Object.<anonymous> Users/k26686/aniruddh/develop/experiment/udc-spet-experiment/pre-commit-keywords/shepherd/src/app/shared/components/ellipsis-overflow/ellipsis-overflow.component.spec.ts:67:51)
...
Users/k26686/aniruddh/develop/experiment/udc-spet-experiment/pre-commit-keywords/shepherd/node_modules/zone.js/dist/zone.js:141:1)
        at Object.<anonymous> Users/k26686/aniruddh/develop/experiment/udc-spet-experiment/pre-commit-keywords/shepherd/node_modules/zone.js/dist/jasmine-patch.js:104:1)

phantomjs-luncher 中的错误

TypeError: Attempted to assign to readonly property. in http://localhost:9876/_karma_webpack_/main.bundle.js (line 14691)
    http://localhost:9876/_karma_webpack_/main.bundle.js:14691:43
    invoke@http://localhost:9876/_karma_webpack_/polyfills.bundle.js:12951:31
    onInvoke@http://localhost:9876/_karma_webpack_/vendor.bundle.js:136846:45
4

0 回答 0