<!--HTML-->
<div id="YourElementId" ng-app='MyModule' ng-controller="MyController">
Hi
</div>
<script>
//JS Code
angular.module('MyModule', [])
.controller('MyController', function ($scope) {
$scope.myfunction = function (data) {
alert("---" + data);
};
});
window.onload = function () {
angular.element(document.getElementById('YourElementId')).scope().myfunction('test');
}
</script>
eval(evaluation: string) {
return eval(evaluation)
}
<div *ngFor="...">
<div *ngIf="eval('...')"></div>
</div>
Run code snippet