function getText(element, value) {
      if (isUndefined(value)) {
        var nodeType = element.nodeType;
        return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';
      }
      element.textContent = value;
    }
@ngdoc method
@name $compileProvider#directive
@kind function

@description
Register a new directive with the compiler.

@param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which
   will match as <code>ng-bind</code>), or an object map of directives where the keys are the
   names and the values are the factories.
@param {Function|Array} directiveFactory An injectable directive factory function. See the
   {@link guide/directive directive guide} and the {@link $compile compile API} for more info.
@returns {ng.$compileProvider} Self for chaining.