title: How to execute ng-change after loading data on custom directive
body: <p>I wrote a custom directive in angular js that is available in <a href="https://plnkr.co/edit/hvuEc9KMJ1exdPiDvT5R?p=info" rel="nofollow noreferrer">plnkr</a>,
  when the directive is loaded it already calls the changed() function on MainCtrl, I need to stop changed() function until the data loads into the directive and after that, it should start to watch the changes on input which is inside the directive and BTW the changed() function should be in MainCtrl as it is in the <a href="https://plnkr.co/edit/hvuEc9KMJ1exdPiDvT5R?p=info" rel="nofollow noreferrer">example</a> so is there any way to stop execution of ng-change  before loading data into directive?
  here is the code:</p>
  
  <pre><code>var app = angular.module('plunker', []);
  
  app.controller('MainCtrl', function($scope) {
    $scope.name = "someName";
    $scope.statusText = "unChanged";
    $scope.changed = function(){
            $scope.statusText = "changed";
        };
  });
  
  
  app.directive("myDirective", function () {
      return {
          restrict: 'EA',
          scope: {
              ngModel: "=",
              ngChange: "="
          },
          templateUrl: "template.html",
          link: function ($scope, elem, attrs) {
  
  
  
          }
      }
  });
  </code></pre>
  
  
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="plunker"&gt;
  
    &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;AngularJS Plunker&lt;/title&gt;
      &lt;script&gt;document.write('&lt;base href="' + document.location + '" /&gt;');&lt;/script&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script data-require="angular.js@1.5.x" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.11/angular.min.js" data-semver="1.5.11"&gt;&lt;/script&gt;
      &lt;script src="app.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body ng-controller="MainCtrl"&gt;
  
      &lt;my-directive ng-model="name" ng-change="changed()"&gt;&lt;/my-directive&gt;
      &lt;p&gt;{{statusText}}&lt;/p&gt;
  
      &lt;script type="text/ng-template" id="template.html"&gt;
        &lt;input type="text" ng-model="ngModel" ng-change="ngChange" &gt;
      &lt;/script&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>