title: Assigning a controller from a directive angularjs 1.2
body: <p>I'm switching from angularJS 1.0 to 1.2 and I'm having some trouble assigning a controller to a directive with a clean scope, without defining a controller in my html with ng-controller. </p>
  
  <p>consider the following scenario:</p>
  
  <pre><code>var myApp=angular.module('myApp',[])
  .controller('parentCtrl',function($scope,$element,$attrs) {
    $scope.helloworld = function(){                                                   
      console.log('hello world from ParentCtrl controller')
    }
  })
  
  .controller('childCtrl',function($scope,$element,$attrs) {
      $scope.helloworld = function(){ 
  
         console.log('hello world from ChildCtrl controller')
  
      }
  })
  .directive('ngParent', function() {
    return {
      controller:'ParentCtrl'
    }
  })
  .directive('ngChild', function() {
    return {
        controller:'ChildCtrl',
        scope:{},
        link:function(scope,element,attrs){
  
        }
     }
  })
  </code></pre>
  
  <p>And HTML:</p>
  
  <pre><code>  &lt;body ng-app="myApp" ng-parent&gt;
        &lt;button ng-click="helloworld()"&gt;Parent Scope click &lt;/button&gt;
        &lt;div ng-child&gt;
           &lt;button ng-click="helloworld()"&gt;Child Scope click &lt;/button&gt;
        &lt;/div&gt;  
    &lt;/body&gt;
  </code></pre>
  
  <p>Right now, both buttons will log "hello world from ParentCtrl controller". However, if I change the parameter scope:{} to scope:true in the ngChild directive, it works and the buttons are calling their respective scopes' helloworld function. But that doesn't make a clean scope like I want it to. </p>
  
  <p>How do I make a clean scope in a directive with angular 1.2, without assigning the controller in my view?</p>
  
  <p>Thanks,
  Andreas</p>