JSFiddle - React, Tailwind, and code Playground

by Ahmad Baktash Hayeri

HTML

<div ng-app="myApp">
  <div ng-controller="ctrl">
    <div class="content"></div>
    <button ng-click="addElement()">
      Add Element
    </button>
  </div>
</div>

JavaScript

angular.module('myApp', [])
  .controller('ctrl', function($scope) {
    $scope.addElement = function() {
    console.log(document.querySelector('.content'))
      document.querySelector('.content')
      .appendChild(document.createElement('p'))
    }
  })
  .directive('someDir', function() {
    return {
      restrict: 'E',
      link: function() {
        console.log('locked and loaded...');
      }
    }
  });