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

How to get client ip address using angularjs ?


 11372

Show ResultANGULARJS


18

<!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     Created   
The power of the user (%)
42%

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     Created   
The power of the user (%)
71%



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

  11.4K     2.4K

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

Click to see more ...

  4.4K     1.3K

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

  4.2K     716

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

Click to see more ...

  2.3K     497

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

Click to see more ...

  1.4K     468

get region angularjsget region angularjsANGULARJS

Click to see more ...

  1.2K     411

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

Click to see more ...

  1.1K     366

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

  785     341

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

Click to see more ...

  638     149

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

Click to see more ...

  486     139