Skip to main content

Posts

Showing posts with the label AngularJs Exception/Error Handling

AngularJs Exception/Error Handling using $exceptionHandler

Hello everyone, I am going to share the AngularJs exception or error handling using   $ exceptionHandler .  The AngularJs $exceptionHandler  is use to catch and handle the exceptions or errors.  The details as given below. For live demo example http://embed.plnkr.co/x6bqJg/preview The HTML Code-Sample < div ng-app ="exceptionApp" ng-controller ="ExceptionCtrl"></ div> The AngularJs Code-Sample var app = angular.module( 'exceptionApp' , []); app.provider({     $exceptionHandler: function () {         var errorHandler = function (ex) {             alert(ex);             //console.log(ex);         };         this .$get = function () {         ...