diff options
| author | Misko Hevery | 2011-02-01 10:01:02 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-02-03 13:26:48 -0800 |
| commit | 245b60d69af7cde614e52f3899846327c211c9f2 (patch) | |
| tree | bcc03e7c5d256bcdf158a7832d8c0101a4799308 /docs/cookbook.helloworld.ngdoc | |
| parent | b6a01bd27dbcd2f9c9df917ecc96b8a2bd88413d (diff) | |
| download | angular.js-245b60d69af7cde614e52f3899846327c211c9f2.tar.bz2 | |
addded cookbook
Diffstat (limited to 'docs/cookbook.helloworld.ngdoc')
| -rw-r--r-- | docs/cookbook.helloworld.ngdoc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/cookbook.helloworld.ngdoc b/docs/cookbook.helloworld.ngdoc new file mode 100644 index 00000000..ba4c6885 --- /dev/null +++ b/docs/cookbook.helloworld.ngdoc @@ -0,0 +1,31 @@ +@workInProgress +@ngdoc overview +@name Cookbook: Hello World +@description + +<doc:example> + <doc:source> + Your name: <input type="text" name="name" value="World"/> + <hr/> + Hello {{name}}! + </doc:source> + <doc:scenario> + iit('should change the binding when user enters text', function(){ + expect(binding('name')).toEqual('World'); + input('name').enter('angular'); + expect(binding('name')).toEqual('angular'); + }); + </doc:scenario> +</doc:example> + +# Things to notice + +Take a look through the source and note: + +* The script tag that {@link guide.bootstrap bootstraps} the angular environment. +* The text {@link angular.widget.HTML input widget} which is bound to the greeting name text. +* No need for listener registration and event firing on change events. +* The implicit presence of the `name` variable which is in the root {@link angular.scope scope}. +* The double curly brace `{{markup}}`, which binds the name variable to the greeting text. +* The concept of {@link guide.data-binding data binding}, which reflects any changes to the + input field in the greeting text. |
