I have 2 views,each one has a controller,I want to send data from View1 to View2 when I click on the "BL" Button:
I tried to use the events my try,but the Controller2 will be activated only when I click on the "BL" Button I thought to use a service to send Data from controller1 to controller2,but I think it's not my case so please is there any help,how can I send data from View1 to View2 thanks
Edit: this is my second try:
View1/controller1:
$scope.BLButton = function(){
$scope.foo = Service.foo;
Service.foo = '85';
}
.factory('Service', function() {
var Service = {
foo: '85'
};
return Service;
});
View2/Controller2:
//this method is called to display the data in the input Text from a web Service
$scope.parentmethod = function() {
//traitement
$scope.foo = Service.foo;
....
}
the problem with my code is that the method "parentmethod" of Controleller2 is never called when I click on the "BL" button