This is what i want:
$http.get('v1/service/:variable', { params: { variable: 'val' } })
so i know that this still just adds the val
as a query param, but i want it to replace the :variable
.
Do you see this happening?
This is what i want:
$http.get('v1/service/:variable', { params: { variable: 'val' } })
so i know that this still just adds the val
as a query param, but i want it to replace the :variable
.
Do you see this happening?
AngularJS's $http
does not support this.
You'll have to do the replacing yourself.
var url = 'v1/service/:variable';
var params = {
variable: 'val'
};
for(var varName in params) {
url = url.replace(':' + varName, params[varName]);
}
$http.get(url);
Or go with a sprintf
-like library.