title: how to pass value from directive to controller
body: <p>Can anybody give me a simple example on how to exchange data between the directive and controller.
  I am a newbie to angularjs and i want to learn how to pass data from cotroller to directive and then back to controller.
  I have learnt on how to pass value from controller to directive ,but the poblem is I cant achieve the value from directive back to controller ..can somebody help</p>
  
  <p>html code</p>
  
  <pre><code> &lt;div ng-controller="MyCtrl"&gt;
  &lt;pass-object obj="obj"&gt;&lt;/pass-object&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>javascript code</p>
  
  <pre><code> var myApp = angular.module('myApp',[]);
  
   myApp.directive('passObject', function() {
  return {
      restrict: 'E',
      scope: { obj: '=' },
      template: '&lt;div&gt;Hello, {{obj.prop}}!&lt;/div&gt;'
  };
  });
  
  myApp.controller('MyCtrl', function ($scope) {
  $scope.obj = { prop: "world" };
  });
  </code></pre>