@@ -32,9 +32,9 @@ In the following example we will build a form to calculate the costs of an invoi
32
32
Let's start with input fields for quantity and cost whose values are multiplied to produce the total of the invoice:
33
33
34
34
35
- <example>
35
+ <example name="guide-concepts-1" ng-app-included="true" >
36
36
<file name="index.html">
37
- <div ng-init="qty=1;cost=2">
37
+ <div ng-app ng- init="qty=1;cost=2">
38
38
<b>Invoice:</b>
39
39
<div>
40
40
Quantity: <input type="number" ng-model="qty" required >
@@ -102,7 +102,7 @@ The concept behind this is <a name="databinding">"{@link databinding two-way dat
102
102
Let's add some more logic to the example that allows us to enter and calculate the costs in
103
103
different currencies and also pay the invoice.
104
104
105
- <example module="invoice1" >
105
+ <example name="guide-concepts-2" ng-app-included="true" >
106
106
<file name="invoice1.js">
107
107
angular.module('invoice1', [])
108
108
.controller('InvoiceController', function() {
@@ -128,7 +128,7 @@ different currencies and also pay the invoice.
128
128
});
129
129
</file>
130
130
<file name="index.html">
131
- <div ng-controller="InvoiceController as invoice">
131
+ <div ng-app="invoice1" ng- controller="InvoiceController as invoice">
132
132
<b>Invoice:</b>
133
133
<div>
134
134
Quantity: <input type="number" ng-model="invoice.qty" required >
@@ -191,7 +191,7 @@ from the web, e.g. by calling the Yahoo Finance API, without changing the contro
191
191
192
192
Let's refactor our example and move the currency conversion into a service in another file:
193
193
194
- <example module="invoice2 ">
194
+ <example name="guide-concepts-2" ng-app-included="true ">
195
195
<file name="finance2.js">
196
196
angular.module('finance2', [])
197
197
.factory('currencyConverter', function() {
@@ -228,7 +228,7 @@ Let's refactor our example and move the currency conversion into a service in an
228
228
}]);
229
229
</file>
230
230
<file name="index.html">
231
- <div ng-controller="InvoiceController as invoice">
231
+ <div ng-app="invoice2" ng- controller="InvoiceController as invoice">
232
232
<b>Invoice:</b>
233
233
<div>
234
234
Quantity: <input type="number" ng-model="invoice.qty" required >
@@ -302,7 +302,7 @@ to something shorter like `a`.
302
302
Let's finish our example by fetching the exchange rates from the Yahoo Finance API.
303
303
The following example shows how this is done with Angular:
304
304
305
- <example module="invoice3 ">
305
+ <example name="guide-concepts-3" ng-app-included="true ">
306
306
<file name="invoice3.js">
307
307
angular.module('invoice3', ['finance3'])
308
308
.controller('InvoiceController', ['currencyConverter', function(currencyConverter) {
@@ -356,7 +356,7 @@ The following example shows how this is done with Angular:
356
356
}]);
357
357
</file>
358
358
<file name="index.html">
359
- <div ng-controller="InvoiceController as invoice">
359
+ <div ng-app="invoice3" ng- controller="InvoiceController as invoice">
360
360
<b>Invoice:</b>
361
361
<div>
362
362
Quantity: <input type="number" ng-model="invoice.qty" required >
0 commit comments