-
-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work correctly in angular9 app and IE11 #294
Comments
Thanks for checking the CDN version, this makes it sound like the bug is in the Angular compiler, rather than in XRegExp. I'd open an issue on the Angular repo (or follow whatever their recommended support process is) and see what they have to say about it |
Thanks! Please put angular issue link here so all interested parties can track it |
@josephfrazier exactly the same happens in our app, please let us know your findings. |
@josephfrazier any update on this? |
Oh, I was suggesting that @orkisz should create an Angular issue, not that I would do it myself. You could do it as well. |
Just leaving this here for anyone ending up on this issue: Update: import * as XRegExp from 'xregexp'; This doesn't work in Angular 9. Also, only importing it locally doesn't work either.
(Even in Chrome) Solution: declare function XRegExp(pattern: string): RegExp; PS: There's probably a better way to use the official typings, this was enough for me though. |
@josephfrazier @orkisz @bernatgy
|
Thanks for confirming, I'm going to close this for now. |
I have following expression:
Before migrating to angular9 (from 8) below examples work seamlessly:
However, after migrating to ng9 + Ivy, all of those ceased to work and they return false in IE 11. My regexp returns true only for one-letter strings.
What is interesting, if I use XRegexp from CDN (global object) instead of NPM version all is back to normal. Looks like ng compiler harms something in the library.
It's easily reproducible, I created an example app here https://github.com/orkisz/regexp-test
test -> https://github.com/orkisz/regexp-test/blob/master/src/app/app.component.ts
The text was updated successfully, but these errors were encountered: