Gọi hàm bên trong scope từ javascript với angular

Gọi hàm bên trong scope từ javascript với angular bị lỗi

Ví dụ họi hàm bên trong scope từ javascript với angular

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl" id="divID">
    Ví dụ gọi hàm trong scope Angular từ JAVASCRIPT
    <hr />
    <span onclick="OnSuccessData()">Click Me CALL</span>
</div>
<script>
function OnSuccessData() {
    angular.element(document.getElementById('divID')).scope().TestAngularMethod('IIF');
    angular.element(document.getElementById('divID')).scope().HoTen="VAN BINH";
    // Nếu gọi từ cửa sổ cha thì thêm
    //window.parent.angular.element(window.parent.document.getElementById('divID'))....
    //  window.parent.IIF_f_Close_Popup(); // đóng cửa sổ nếu dùng app iif
}
///
var app = angular.module("myApp",  []);
app.controller('myCtrl', ["$scope", function ($scope) {
    $scope.HoTen="A";
    $scope.TestAngularMethod = function (x) {
        alert('Hello:'+x);
    }
}]);
</script>

 Nếu lỗi gọi thêm lệnh
 

<input id="Button1" class="Button1" onclick="callAngularFun()" type="button" value="button" />
<script>
function callAngularFun()
{
   
    angular.element(document.getElementById('myApp')).scope().loadData_ChungTu_btLoad();
}
</script>
$scope.loadData_ChungTu_btLoad = function () {
   
           $interval(function () {
               $scope.loadData_ChungTu_LoadFrm();
          }, 100,1);
   }
$scope.loadData_ChungTu_btLoad = function () {
 // code....

}
 

https://embed.plnkr.co/dYuLXQAsA0GE5cQj33AX/

Bạn này gặp lỗi liên hệ mình giải quyết nha.