diff options
| author | Caitlin Potter | 2014-02-15 20:19:10 -0500 |
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-16 19:03:45 +0000 |
| commit | f7fad29fd99cabdbb17fa02dc214de2354f93cdf (patch) | |
| tree | 61fc2299fe732d189f85b0afe84e70667bf9fd13 /docs/content/guide/module.ngdoc | |
| parent | 896e34689dfe0d66c09627179940a7b3eaac41bc (diff) | |
| download | angular.js-f7fad29fd99cabdbb17fa02dc214de2354f93cdf.tar.bz2 | |
docs(bike-shed-migration): convert guide <doc:...> examples to <example>...
This CL also contains style fixes as the converted scripts caused jshint to complain.
Diffstat (limited to 'docs/content/guide/module.ngdoc')
| -rw-r--r-- | docs/content/guide/module.ngdoc | 111 |
1 files changed, 56 insertions, 55 deletions
diff --git a/docs/content/guide/module.ngdoc b/docs/content/guide/module.ngdoc index ad5fde13..747209c2 100644 --- a/docs/content/guide/module.ngdoc +++ b/docs/content/guide/module.ngdoc @@ -26,26 +26,26 @@ Important things to notice: * Notice the reference to the `myApp` module in the `<html ng-app="myApp">`, it is what bootstraps the app using your module. -<doc:example module='myApp'> - <doc:source> - <script> - // declare a module - var myAppModule = angular.module('myApp', []); - - // configure the module. - // in this example we will create a greeting filter - myAppModule.filter('greet', function() { - return function(name) { - return 'Hello, ' + name + '!'; - }; - }); - - </script> +<example module='myApp'> + <file name="index.html"> <div> {{ 'World' | greet }} </div> - </doc:source> -</doc:example> + </file> + + <file name="script.js"> + // declare a module + var myAppModule = angular.module('myApp', []); + + // configure the module. + // in this example we will create a greeting filter + myAppModule.filter('greet', function() { + return function(name) { + return 'Hello, ' + name + '!'; + }; + }); + </file> +</example> @@ -67,49 +67,50 @@ that are relevant to tests. The above is only a suggestion, so feel free to tailor it to your needs. -<doc:example module='xmpl'> - <doc:source> - <script> - angular.module('xmpl.service', []). - value('greeter', { - salutation: 'Hello', - localize: function(localization) { - this.salutation = localization.salutation; - }, - greet: function(name) { - return this.salutation + ' ' + name + '!'; - } - }). - value('user', { - load: function(name) { - this.name = name; - } - }); +<example module='xmpl'> + <file name="index.html"> + <div ng-controller="XmplController"> + {{ greeting }}! + </div> + </file> + + <file name="script.js"> + angular.module('xmpl.service', []). + value('greeter', { + salutation: 'Hello', + localize: function(localization) { + this.salutation = localization.salutation; + }, + greet: function(name) { + return this.salutation + ' ' + name + '!'; + } + }). + value('user', { + load: function(name) { + this.name = name; + } + }); - angular.module('xmpl.directive', []); + angular.module('xmpl.directive', []); - angular.module('xmpl.filter', []); + angular.module('xmpl.filter', []); - angular.module('xmpl', ['xmpl.service', 'xmpl.directive', 'xmpl.filter']). - run(function(greeter, user) { - // This is effectively part of the main method initialization code - greeter.localize({ - salutation: 'Bonjour' - }); - user.load('World'); - }) + angular.module('xmpl', ['xmpl.service', 'xmpl.directive', 'xmpl.filter']). + run(function(greeter, user) { + // This is effectively part of the main method initialization code + greeter.localize({ + salutation: 'Bonjour' + }); + user.load('World'); + }); - // A Controller for your app - var XmplController = function($scope, greeter, user) { - $scope.greeting = greeter.greet(user.name); - } - </script> - <div ng-controller="XmplController"> - {{ greeting }}! - </div> - </doc:source> - </doc:example> + // A Controller for your app + var XmplController = function($scope, greeter, user) { + $scope.greeting = greeter.greet(user.name); + }; + </file> +</example> |
