Problem with item navigation when I use $compileProvider


#1

Hi! When I use $compileProvider to remove the ‘unsafe’ from links the navigation for the items from the list doesn’t work.

    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|tapatalk):/);

#2

More details:
I have created a new app.

ionic start test tabs

and when i inject the $compileProvider in the config function in app.js file

The chats are showed, but I can’t go to a chat details (chat-details.html)


#3

i have the same issue :frowning:

i suspect somehow the navigation reference

href="#/tab/chats/{{chat.id}}"

is “sanitized” out. in ionic template tabs see file

\www\templates\tab-chats.html

i seem not to get the regex pattern in

$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|tapatalk):/);

right, to keep in app links.

pls help


#4

The problem was that I missed the ‘file’ string in the regex pattern.
This works fine
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|file|tapatalk):/);


#5

well in my case this helped:

$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|http|maps|geo|sms|tel|mailto|app|file|ghttps?|ms-appx|x-wmapp0):/);

well it works now :slight_smile: