title: Angularjs: how to read object in Directive
body: <p>I have passed an object from controller to directive but when i am reading object in directive i am not able to, it seems in directive object is being read as string.Code is below , i wane to read City and State from the object.</p>
  
  <pre><code>Html File
  
  &lt;div ng-controller="WeatherController"&gt;    
  &lt;div weather ng-object="{{Object}}"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  Controller
  .controller('WeatherController', ['$scope', function ($scope) {
     $scope.webpartData.OverviewData.Person.Address.City;
              $scope.Object = {
                  City: '',
                  State: ''
              };
              $scope.Object.City = 'TestCity';
              $scope.Object.State = 'TestState';         
          });
      })
  }])
  
  
  Directive
  
  
  angular.module('WeatherModule', [])
  .directive('Weather', ["$timeout", function($timeout) {
      return {
          restrict: 'EA',
          template: '&lt;div id="weather"&gt;&lt;/div&gt;',
          scope: {
              ngObject: '@ngObject'
          },
          link: function(scope, element, attrs) {
              scope.$watch('ngObject', function(value) {
                  scope.ngObject = value;
              });
              $timeout(function() {
                  console.log('Location' + scope.Object.City + ',' + scope.Object.State);
              }, 100);
          }
      };
  }])
  </code></pre>