JSFiddle - React, Tailwind, and code Playground

HTML

<button onclick="_ajaxCUSTOMER('5')">
  Click Here to send 5
</button>
<bill>
</bill>

JavaScript

var app = angular.module('app', []);
app.factory('broadcastService', ['$rootScope',
  function($rootScope) {
    var factory = {};
    factory.sendAjaxResut = function(name, obj) {
      console.log(' -- $broadcast ');
      $rootScope.$broadcast(name, obj);
    }
    return factory;
  }
]);

app.directive("bill", [directive]);

function directive() {
  return {
    restrict: "E",
    link: function($scope) {
      $scope.$on("b1", function(e, a) {
        console.log('-- directive')
      });
    }
  }
}



// pure js : 

function _ajaxCUSTOMER(e) {
  angular
    .injector(['ng', 'app'])
    .get("broadcastService")
    .sendAjaxResut("b1", e);
}