ngx-smart-modal
ngx-smart-modal copied to clipboard
IE11 can't do getModal() by identifier
I'm submitting a ... (check one with "x")
[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
for IE11 browser when try to getModal() by identifier the browser throws an error. I'm runnig an Angular5 project and this issue occurs for
"ngx-smart-modal": "^7.2.1",
In my code: import { NgxSmartModalService } from 'ngx-smart-modal'; constructor( ... private ngxModal: NgxSmartModalService, ... ) this.ngxModal.getModal('actionModal')
when call that method the browser throws an Error
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- Smart Modal version: 0.8.x
- Angular version: 2.0.x
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
- Language: [all | TypeScript X.X | ES6/7 | ES5]
Hi @kstamatov85, did you activate polyfills in your project ?
Yes, they are active. When I downgrade to "ngx-smart-modal": "7.1.1", the issue does not exists
I was have same issue with chrome then i just solve it by wrap the code inside setTimeout like
setTimeout(() => {
this.modalService.open('modalId');
}, 0);
Check the solution available there : https://github.com/maximelafarie/ngx-smart-modal/issues/240#issuecomment-566857685
Adding a setTimeout didn't resolve the case for me (in IE). Anyway adding the pollyfils seems to be the way to go, at least it permits to avoid adding patchs for IE all over the applicative code.