-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (32 loc) · 1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en-US">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
<div data-ng-app="myStuff" data-ng-controller="myController">
<p>First name: <input type="text" ng-model="firstName"></p>
<p>Last name: <input type="text" ng-model="lastName"></p>
<p>{{firstName + " " + lastName | uppercase}}</p>
<p>Sales: {{sales | currency}}</p>
</div>
<div data-ng-app="myApp" data-ng-controller="customersCtrl">
<ul>
<li ng-repeat="x in names">
{{ x.Name + ', ' + x.Country }}
</li>
</ul>
</div>
<script>
var app = angular.module("myStuff",[]);
app.controller("myController", function($scope){
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.sales = 100.5;
});
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://localhost/angular/customers.php")
.success(function(response) {$scope.names = response.records;});
});
</script>
</body>
</html>