Aşağıdaki param: Aşağıdaki listede nasıl param olabilirim? BenTypeError: undefined özelliği için 'search' özelliği okunamaz. Location.search()
TypeError: Cannot read property 'search' of undefined
at Object.async (abcd.html?kId=pqr)
url, aşağıdaki hatayı alıyorum:
http://localhost:8080/.........../abcd.html?kId=pqr
Kodu:
var app = angular.module('angModule', [], function($locationProvider) {
$locationProvider.html5Mode(true);
});
app.factory(
'myService',
function($http,$location) {
return {
async : function() {
return $http
.get('http://localhost:8080/...........,,,,./...',{params:{"kId": $location.search()['kId'] }});
}
};
});
Paylaşılan kodda '$ location.search()' göremiyorum ..? –