0

I am trying to pass data from one page to another in angular js using service

angular.module('myApp', [])
    .service('sharedProperties', function () {
        var AccountNumber;

        return {
            getProperty: function () {
                return AccountNumber;
            },
            setProperty: function(value) {
                AccountNumber= value;
            }
        };
    });
function CtrlA($scope, sharedProperties) {
       sharedProperties.setProperty($scope.AccountNumber);
}

function CtrlB($scope, sharedProperties) {
       $scope.accno = sharedProperties.getProperty();
}

Can anyone please help, i want to pass data between multiple pages without using ui.router.

I want to pass page A input values to page B

Mayank Kapahi
  • 316
  • 4
  • 16

0 Answers0