I've been testing Angularjs for a project and I would like to know how to capture data on a controller from view and pass this data to another controller.
This pseudocode exemplifies what I want to do:
controller1('$scope', function($scope){
var val1 = $scope.dataFromView;
});
controller2('$scope', function($scope, controller1 ){
var val2 = controller1.val1;
//then do something with val1
});