JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app='MyModule' ng-controller="MyController" id="MyController">
  Hi
</div>

JavaScript

angular.module('MyModule', [])
  .controller('MyController', function($scope) {
    $scope.myfunction = function(data) {
      alert("---" + data);
    };
  });

angular.element(document.getElementById('MyController')).scope().myfunction('test');