-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_hello.html
More file actions
39 lines (35 loc) · 1.19 KB
/
01_hello.html
File metadata and controls
39 lines (35 loc) · 1.19 KB
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
<!DOCTYPE html>
<html lang="en" ng-app>
<!-- ng-app inizializza Angular su un preciso elemento HMTL, in questo caso tutta la pagina -->
<head>
<meta charset="UTF-8">
<title>AngularJS template</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Libs + script -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<script src="bower_components/angular/angular.min.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div class="container">
<h1>AngularJS Hello world</h1>
<!-- ng-model assegna una variabile Angular a un elemento -->
<input type="text" class="form-control" ng-model="userInput">
<p>Stai scrivendo: <strong>{{userInput}}</strong></p>
<!-- le {{ }} sono espressioni di binding -->
<hr>
<div class="row">
<div class="col-md-4">
<input type="number" class="form-control" ng-model="num1">
</div>
<div class="col-md-4">
<input type="number" class="form-control" ng-model="num2">
</div>
<div class="col-md-4">
<p>Totale: <strong>{{num1 + num2}}</strong></p>
<!-- Nelle espressioni di binding si possono scrivere comandi Javascript -->
</div>
</div>
</div>
</body>
</html>