Why ng-href behaving weird while parsing geo string

后端 未结 1 765
遇见更好的自我
遇见更好的自我 2021-01-14 22:15

I\'ve multiple geo string like geo:0,0q=1+a+bc, and I\'m gonna assign this to ng-href of the anchor tag. Like below I\'m doing it.

1条回答
  •  醉梦人生
    2021-01-14 22:43

    You need to use aHrefSanitizationWhitelist([regexp]);

    regex should match the url of your's So in your case it should be like

     $compileProvider.aHrefSanitizationWhitelist(/^\s*(geo):/);
    

    regEx:- starting with geo followed by ' : '

    Please see $compileProvider Documentation for more info.

    Plunker

    0 讨论(0)
提交回复
热议问题