Hi,

This is a crosspost from 
https://stackoverflow.com/questions/30594850/how-to-url-encode-expressions-of-template-variable-with-interpolate

I have a variable 

x = "http://example.com?a={{a}}&b={{b}}

This variable is then used in a 

ng-src={{x}}

Therefore it is important for me to url encode the variables a and b.

What i do currently is:

var func = $interpolate($scope.x);var url = func($scope);return  
$sce.trustAsResourceUrl(url);


My problem is that when a or b contains spaces they are not url encoded.

How can i tell the $interpolate function to url encode the variables a and 
b?



Thanks,

David



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to