angular2-mdl-ext icon indicating copy to clipboard operation
angular2-mdl-ext copied to clipboard

fix issues Attempt to use a destroyed view: detectChanges in renderValue

Open perjerz opened this issue 6 years ago • 3 comments

image

image

I have an error of detectChanges in renderValue function, to solve this problem just check view is destroyed before call detectChanges function.

perjerz avatar Jan 01 '19 13:01 perjerz

Coverage Status

Coverage increased (+0.006%) to 96.259% when pulling eae7580149f746b3de86855cdae4fbf8ff603249 on perjerz3434:master into 0b8f55939e2e84886e5eeebcd553473a400c25be on mseemann:master.

coveralls avatar Jan 01 '19 13:01 coveralls

hi. thx for your contribution.

the solution for your problem may solve your problem but i think it isn't a general solution. The question is: why is the renderValue method is called after the component is destroyed.

I would suggest do the following:

  • write a test that reproduces the error
  • find the reason why the renderValue method is called after the component is destroyed
  • fix this problem - e.g. make the test pass

Let me know if you need any help.

mseemann avatar Jan 03 '19 09:01 mseemann

When mdl-select is used with *ngIf, it is possible to cd.detectChanges() with componet has already destroyed which produce a bug.

perjerz avatar Jan 23 '19 17:01 perjerz