JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app='myApp'>
<div ng-controller='ctrl' id='ctrl'>
{{msg}}
<button id='btn' ng-click='sayHello()'>
Go
</button >
</div>
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('ctrl', function($scope){
$scope.sayHello = function() {
$scope.msg = 'Hello';
}
});
setTimeout(function(){
var scope = angular.element(document.getElementById("btn")).scope();
scope.$apply(function () {
scope.sayHello();
});
}, 2000)