From 4804c83b7db5770d5d02eea9eea4cc012b4aa524 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 14 Dec 2011 02:55:31 +0100 Subject: docs(compiler): update the compiler docs --- .../dev_guide.compiler.directives_widgets.ngdoc | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 docs/content/guide/dev_guide.compiler.directives_widgets.ngdoc (limited to 'docs/content/guide/dev_guide.compiler.directives_widgets.ngdoc') diff --git a/docs/content/guide/dev_guide.compiler.directives_widgets.ngdoc b/docs/content/guide/dev_guide.compiler.directives_widgets.ngdoc deleted file mode 100644 index 1a0b1ad5..00000000 --- a/docs/content/guide/dev_guide.compiler.directives_widgets.ngdoc +++ /dev/null @@ -1,47 +0,0 @@ -@ngdoc overview -@name Developer Guide: Angular HTML Compiler: Comparing Directives and Attribute Widgets -@description - -Although directives and {@link dev_guide.compiler.widgets attribute widgets} appear the same in a -template (`ng:init` is a directive, `ng:repeat` is an attribute widget), there is a difference in -the order in which they are evaluated. The user of existing directives or widgets cannot determine -the order of evaluation. The evaluation order is the responsibility of the developer creating -custom directives and widgets. - -For example, consider this piece of HTML, which uses the `ng:repeat`, `ng:init`, and `ng:bind` -widget and directives: - -
-
-
- -Notice that the order of execution matters here. Because we want to run the `ng:init="a=a+1` and -`ng:bind="person"` once for each `person in people`, we need to execute {@link -api/angular.widget.@ng:repeat ng:repeat} to make copies of the `
  • ` element before we run the -{@link api/angular.directive.ng:init ng:init}, and {@link api/angular.directive.ng:bind ng:bind} -for each of the `
  • `copies. - -If you implemented `ng:repeat` as a directive, there would be no guarantee that the attributes -`ng:repeat`, `ng:init`, and `ng:bind` would be evaluated in the order they are declared, because -the order of element attributes in HTML is not significant to the browser. - -So, when creating a custom HTML attribute, you will have to consider whether a directive or a -widget is more appropriate. When the order of execution doesn't matter, directives are the right -choice. In a situation where the order matters and one attribute should be processed with a higher -priority than others, use a widget for the attribute that must be processed first. - - -## Related Topics - -* {@link dev_guide.compiler.directives Understanding Angular Directives} -* {@link dev_guide.compiler.widgets Understanding Angular Widgets} - -## Related API: - -* {@link api/angular.directive Directive API} -* {@link api/angular.widget Widget API} -- cgit v1.2.3