Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<!--script src="http://ci.angularjs.org/view/AngularJS/job/angular.js-angular-master/lastSuccessfulBuild/artifact/build/angular.js"></script-->
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-app="testing">
  <div data-comp></div>
</body>
</html>
 
var testing = angular.module('testing', []);
testing.run(function($templateCache) {
  $templateCache.put('hello.html', '<p>Hello</p>');
});
var Controller = function() {
  console.log('controller constructor');
};
testing.directive('comp', function() {
  return {
    scope: true,
    templateUrl: 'hello.html',
    //template: '<p>Hello</p>',
    controller: Controller,
    compile: function() {
      
      //return function() {
      //  console.log('single link');
      //};
      
      return {
        pre: function(scope, template, attr, ctrl) {
          console.log("pre-link: ", ctrl);
        },
        post: function() {
          console.log("post-link");
        }
      };
    }
  };
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers