Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html >
<html  ng-app="myApp" >
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div link>aaaaaa</div>
</body>
</html>
 
angular.module("myApp", []);
angular.module('myApp')
.directive('link', function() {
  return {
    restrict: 'EA',
    transclude: true,
    controller:
    function($scope, $element, $transclude) {
      $transclude(function(clone) {
        
        var a = angular.element('<a>');
        a.attr('href', clone.text());
        a.text(clone.text());
        $element.append(a);
      });
    }
  };
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
yunlzhengpro
0viewers