Hello guys..
What is the problem?
Html:
- >
- <html ng-app="App">
- <head>
- <title>Angulartitle>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">script>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="App.js">script>
- head>
- <body ng-controller="Controller">
- <div class="container">
- <table class="table">
- <tr>
- <th>IDth>
- <th>Nameth>
- <th>EMailth>
- tr>
- <tr ng-repeat="user in users">
- <td>{{user.id}}td>
- <td>{{user.name}}td>
- <td>{{user.email}}td>
- tr>
- table>
- div>
- body>
- html>
Js:
- var app = angular.module("App", []);
- app.controller("Controller", function ($scope, $http) {
- var url = "https://jsonplaceholder.typicode.com/users";
- $http.get(url).then(function (response) {
- $scope.users = response;
- });
- });
Pawan Kumar TiwariPosted Apr 24, 2018, 4:48 AM