docs(guide/concepts): move ng-app into example text

Closes #6639
This commit is contained in:
Peter Bacon Darwin
2014-03-18 07:07:36 +00:00
parent 959297c38a
commit f7b36844e6

View File

@@ -32,9 +32,9 @@ In the following example we will build a form to calculate the costs of an invoi
Let's start with input fields for quantity and cost whose values are multiplied to produce the total of the invoice: Let's start with input fields for quantity and cost whose values are multiplied to produce the total of the invoice:
<example> <example name="guide-concepts-1" ng-app-included="true">
<file name="index.html"> <file name="index.html">
<div ng-init="qty=1;cost=2"> <div ng-app ng-init="qty=1;cost=2">
<b>Invoice:</b> <b>Invoice:</b>
<div> <div>
Quantity: <input type="number" ng-model="qty" required > 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
Let's add some more logic to the example that allows us to enter and calculate the costs in Let's add some more logic to the example that allows us to enter and calculate the costs in
different currencies and also pay the invoice. different currencies and also pay the invoice.
<example module="invoice1"> <example name="guide-concepts-2" ng-app-included="true" >
<file name="invoice1.js"> <file name="invoice1.js">
angular.module('invoice1', []) angular.module('invoice1', [])
.controller('InvoiceController', function() { .controller('InvoiceController', function() {
@@ -128,7 +128,7 @@ different currencies and also pay the invoice.
}); });
</file> </file>
<file name="index.html"> <file name="index.html">
<div ng-controller="InvoiceController as invoice"> <div ng-app="invoice1" ng-controller="InvoiceController as invoice">
<b>Invoice:</b> <b>Invoice:</b>
<div> <div>
Quantity: <input type="number" ng-model="invoice.qty" required > 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
Let's refactor our example and move the currency conversion into a service in another file: Let's refactor our example and move the currency conversion into a service in another file:
<example module="invoice2"> <example name="guide-concepts-2" ng-app-included="true">
<file name="finance2.js"> <file name="finance2.js">
angular.module('finance2', []) angular.module('finance2', [])
.factory('currencyConverter', function() { .factory('currencyConverter', function() {
@@ -228,7 +228,7 @@ Let's refactor our example and move the currency conversion into a service in an
}]); }]);
</file> </file>
<file name="index.html"> <file name="index.html">
<div ng-controller="InvoiceController as invoice"> <div ng-app="invoice2" ng-controller="InvoiceController as invoice">
<b>Invoice:</b> <b>Invoice:</b>
<div> <div>
Quantity: <input type="number" ng-model="invoice.qty" required > Quantity: <input type="number" ng-model="invoice.qty" required >
@@ -302,7 +302,7 @@ to something shorter like `a`.
Let's finish our example by fetching the exchange rates from the Yahoo Finance API. Let's finish our example by fetching the exchange rates from the Yahoo Finance API.
The following example shows how this is done with Angular: The following example shows how this is done with Angular:
<example module="invoice3"> <example name="guide-concepts-3" ng-app-included="true">
<file name="invoice3.js"> <file name="invoice3.js">
angular.module('invoice3', ['finance3']) angular.module('invoice3', ['finance3'])
.controller('InvoiceController', ['currencyConverter', function(currencyConverter) { .controller('InvoiceController', ['currencyConverter', function(currencyConverter) {
@@ -356,7 +356,7 @@ The following example shows how this is done with Angular:
}]); }]);
</file> </file>
<file name="index.html"> <file name="index.html">
<div ng-controller="InvoiceController as invoice"> <div ng-app="invoice3" ng-controller="InvoiceController as invoice">
<b>Invoice:</b> <b>Invoice:</b>
<div> <div>
Quantity: <input type="number" ng-model="invoice.qty" required > Quantity: <input type="number" ng-model="invoice.qty" required >