Kod
http://strona.pl/plik?code=123
Według internetów powinienem użyć $location.search(), ale zwraca mi undefined (cały obiekt jest pusty). Mam taki kod:
Kod
app.controller('table', function($scope, $http, $location) {
$code = $location.search().code;
$http.get("json.php?module=sensors&code="+code).then(function(response) {
$scope.zgazowarki = response.data;
});
console.log($code);
});
$code = $location.search().code;
$http.get("json.php?module=sensors&code="+code).then(function(response) {
$scope.zgazowarki = response.data;
});
console.log($code);
});
Macie pomysł jak to rozwiązać? Nadmienię, że w HTMLu mam dobrze połączony skrypt.