diff --git a/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc b/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc
index 8ffa760eaeaa..617fe9dfbfa0 100644
--- a/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc
+++ b/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc
@@ -2,8 +2,93 @@
@name Developer Guide: Angular HTML Compiler: Testing a New DOM Element
@description
+"The angular compiler teaches your browser new tricks." Let's take a look at some of the magic
+possible with the angular {@link api/angular.module.ng.$compileProvider.directive directive}.
+Below is the `myState` directive defined in `myModule` module. It shows examples of use of other
+directives such as
+{@link api/angular.module.ng.$compileProvider.directive.ng-init ng-init},
+{@link api/angular.module.ng.$compileProvider.directive.ng-click ng-click},
+{@link api/angular.module.ng.$compileProvider.directive.ng-mouseenter ng-mouseenter}, and
+{@link api/angular.module.ng.$compileProvider.directive.ng-mouseleave ng-mouseleave} directives
+as well.
-"Testing, testing, come in, over?"
+Essentially it allows elements in the DOM that have the `my-state` attribute to be modified,
+in this case replaced, with the `template` code below. The `link` function is responsible for the
+code that actually updates the DOM
+
+
+$rootScope.myState: {{myState}}
+
+describe('directives', function() { + var directiveScope, element, compile; + + beforeEach(module('myModule')); // Define the module context for the test + + it('myState', inject(function($rootScope, $compile) { + var isolate = true; + directiveScope = $rootScope.$new(isolate); // The directive has isolate scope + $rootScope.myState = { // + over: false, // Set the values in $rootScope before $compile + selected: true // + }; + element = $compile('')(directiveScope); + directiveScope.$apply(); + expect(element.text()).toBe("So"); + })); +}); ++ +If we had not created a separate directiveScope for the test above, and instead compiled and called +`$apply` in the `$rootScope`, the directive would have overwritten the `myState` object with the +accessor function, and the test would not be accurate. ## Related Topics