ANGULARJS get ip address angularjs - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

How to get client ip address using angularjs ?


 17259

Show ResultANGULARJS


24

<!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>


By        
The power of the user (%)
62%

ANGULARJS


10

// 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.data.query;
});
});
</script>

<div ng-controller="myip">
<span>{{ip}}</span>
</div>

</body>
</html>


By        
The power of the user (%)
80%



The most helpful ANGULARJS solutions

How to get client ip address using angularjs ?How to get client ip address using angularjs ?ANGULARJS

Click to see more ...

  17.3K     2.7K

How to get city from ip address with angularjs ?How to get city from ip address with angularjs ?ANGULARJS

Click to see more ...

  6.4K     1.4K

how to get client machine name and user name using angularjs ?how to get client machine name and user name using angularjs ?ANGULARJS

Click to see more ...

  8.7K     782

How to get local client ip address using angularjs ?How to get local client ip address using angularjs ?ANGULARJS

Click to see more ...

  4K     508

get client country using angularjs ?get client country using angularjs ?ANGULARJS

Click to see more ...

  2.5K     477

get region angularjsget region angularjsANGULARJS

Click to see more ...

  1.9K     413

How to get value from a href using angularjs ?How to get value from a href using angularjs ?ANGULARJS

Click to see more ...

  1.7K     369

how to fill a list from an another file in json format using angularjs ?how to fill a list from an another file in json format using angularjs ?ANGULARJS

Click to see more ...

  1.6K     352

get client time zone using angularjs get client time zone using angularjs ANGULARJS

Click to see more ...

  1.8K     193

How to get keycode using angularjs ?How to get keycode using angularjs ?ANGULARJS

Click to see more ...

  1.4K     159

Welcome aboard!
We are happy you are here and
wish you good net-raft!