You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
I started using mdAutocomplete in my project, and I was wondering how I could use mdHighlightText properly.
My problem is that this directive only highlights the given string if the text starts with it.
Shouldn't it allow to highlight the string anywhere in the text ?
The easy fix would be to replace this :
varregex=newRegExp('^'+sanitize(term),'i'),
By this:
varregex=newRegExp(sanitize(term),'i'),
In the controller code (MdHighlightCtrl).
Actually, the best option would be to allow to use the same comparing function than the one that filters the items in mdAutocomplete... But maybe this will need to much change.
Thank you for your attention !
The text was updated successfully, but these errors were encountered:
@carab@jgoux The idea I have for how to handle this is to allow the user to specify flags, much the same way that JS RegExp handles them. e.g. g for global, i for case-insensitive, etc.
I would also add two extra flags: ^ for 'starts with' and $ for 'ends with'
Hi everyone,
I started using mdAutocomplete in my project, and I was wondering how I could use mdHighlightText properly.
My problem is that this directive only highlights the given string if the text starts with it.
Shouldn't it allow to highlight the string anywhere in the text ?
The easy fix would be to replace this :
By this:
In the controller code (MdHighlightCtrl).
Actually, the best option would be to allow to use the same comparing function than the one that filters the items in mdAutocomplete... But maybe this will need to much change.
Thank you for your attention !
The text was updated successfully, but these errors were encountered: