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

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.