JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<body ng-app="testApp">
    hello world
  <div test-dir></div>

</body>

JavaScript

angular.module('testApp', [])
  .directive('testDir', function () {
    return {
      restrict: 'A',
      template: '<input ng-model="foo"><input ng-model="foo"><div ng-if="bool"><br/>Now it changes the other inputs<input ng-model="$parent.foo"></div>',
      link: function (scope, elem, attrs) {
		scope.foo = "bar";
		scope.bool = true;       
      }
    }
  });