2

Actually I am trying to fill a form in angularjs and its data is recieved in one of the controller...i need to pass the same data to another controller which is needed to be shown on the another web page

1 Answer 1

1

You should make use of angular service to do the same.

Create a service, that will hold model variables.

angular.service("dataService", function() {
    this.value1 = "";  
});

Then you can reference that service in your controllers,

angular.controller("myCntrl1", function($scope, dataService) {
    $scope.value1 = dataService.value1;
});


angular.controller("myCntrl2", function($scope, dataService) {
    $scope.value1 = dataService.value1;
});
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.