Welcome aboard! We are happy you are here and wish you good net-raft!
// you can get server ip address this way
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//code.angularjs.org/snapshot/angular.min.js"></script>
</head>
<body ng-app="getip">
<script>
var app = angular.module('getip', []);
app.controller('myip', function($scope, $http, $location) {
$http.get("http://ip-api.com/json/" + $location.host()).then(function (response) {
$scope.ip = response.query;
});
});
</script>
<div ng-controller="myip">
<span>{{ip}}</span>
</div>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//code.angularjs.org/snapshot/angular.min.js "></script>
</head>
<body ng-app="getip">
<script>
var app = angular.module('getip', []);
app.controller('myip', function($scope, $http) {
$http.get("https://ipinfo.io/").then(function (response) {
$scope.ip = response.data.ip;
});
});
</script>
<div ng-controller="myip">
<span>{{ip}}</span>
</div>
</body>
</html>
The most helpful ANGULARJS solutions
How to get client ip address using angularjs ?ANGULARJS Click to see more ... 19.6K 2.8K