Calling javascript/jquery function from angularJS and vice versa

June 6, 2018 superadmin 0

Call angularJS function from javascript/jquery With the help of angular.element(), You can call your angularJS function from JavaScript or Jquery. In this article I will explain this with a simple short example and let’s see how it will work. Angular Js Controller Below is the simple angularJS controller where I have created a simple function which will show success alert. ANGULAR JS CODE: var app; (function () { app = angular.module(“MyApp”, []); })(); app.controller(‘MyController’, ["$scope", function ($scope) { $scope.SuccessAlert = function () { alert('Welcome to angular js method.'); } }]); HTML: Copy below html code: <div ng-app=”MyApp” ng-controller=”MyController” id=”myCont”> This [...]