convert angular.js function to angular 10

  angular10, angularjs, typescript

$scope.forgotPasswordOtp = function () {

            if (!$scope.hasOwnProperty('recovery')) {
                Notify.alert('Invalid OTP');
                return;
            }

            let postData = {
                data: $scope.displayData.data,
                otp: $scope.recovery.otp
            };

            loaderFactory.display("Please wait!");

            AppService.post('users/reset/otp/confirm', true, postData)
            .success(function(data) {
                loaderFactory.hide();
                $state.go('auth.reset', {paramData : postData});
            })
            .error(function(error) {
                loaderFactory.hide();
                AppService.isAuth(error);
            });
        };

i want to convert this function in to angular10 typescript

Source: AngularJS Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.