aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
diff options
context:
space:
mode:
authorIgor Minar2011-06-15 22:31:40 -0700
committerIgor Minar2011-06-15 22:31:40 -0700
commitb842642b574a2b95c53b791308ed1bf8ff9d304d (patch)
treefb26431c5372be74de2105df77e94dea4f198489 /docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
parentd428c9910e66246c2af46602499acaeaf187d75b (diff)
downloadangular.js-b842642b574a2b95c53b791308ed1bf8ff9d304d.tar.bz2
docs - stripping extra new lines
Diffstat (limited to 'docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc')
-rw-r--r--docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc20
1 files changed, 0 insertions, 20 deletions
diff --git a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
index 62edd04f..906e0127 100644
--- a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
+++ b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc
@@ -3,24 +3,19 @@
@name Developer Guide: Angular HTML Compiler: Widgets: Creating Custom Widgets
@description
-
When you create your own widgets, you must set up your own namespace for them. (See
dev_guide.bootstrap Initializing Angular} for information about namespaces in angular.)
-
Let's say we would like to create a new element type in the namespace `my` that can watch an
expression and `alert()` the user with each new value:
-
<pre>
// An element widget
<my:watch exp="name"/>
</pre>
-
You can implement `my:watch` like this:
-
<pre>
angular.widget('my:watch', function(compileElement) {
var compiler = this;
@@ -35,15 +30,11 @@ angular.widget('my:watch', function(compileElement) {
</pre>
-
-
# Creating a Custom Attribute Widget
-
Let's implement the same widget as in the example in Defining an Element Widget, but this time as
an attribute that can be added to any existing DOM element:
-
<pre>
// An attribute widget (my-watch) in a div tag
<div my-watch="name">text</div>
@@ -62,11 +53,8 @@ angular.widget('@my:watch', function(expression, compileElement) {
</pre>
-
-
# Live Example of a Custom Element Widget
-
<doc:example>
<doc:source>
<script>
@@ -88,29 +76,21 @@ angular.widget('my:time', function(compileElement){
</doc:example>
-
-
# Additional Compiler Methods for Custom Widgets
-
The angular compiler exposes methods that you may need to use of when writing your own widgets and
directives. For example, the `descend()` method lets you control whether the compiler ignores or
processes child elements of the element it is compiling. For information on this and other
compiler methods, see the {@link api/angular.compile Compiler API doc}.
-
-
## Related Topics
-
* {@link dev_guide.compiler Angular HTML Compiler}
* {@link dev_guide.compiler.directives Angular Directives}
* {@link dev_guide.compiler.widgets Angular Widgets}
* {@link dev_guide.compiler.directives.creating_directives Creating Custom Directives}
-
## Related API
-
* {@link api/angular.compile Compiler API}