I have two controller in an angularApp with following codes
Controller:Devicectr
function Devicectr($scope, $http) {
$scope.Devices = [{ Id: 1, Devicename: "MasterDeviceA" },
{ Id: 1, Devicename: "MasterDeviceB" },
{ Id: 1, Devicename: "MasterDeviceC" }];
$scope.ActiveDevice = $scope.Devices[0] //
};
Controller:PreviewCtr
function Devicectr($scope, $http) {
$scope.ViewDevice=null; // Here i want to read the $scope.ActiveDevice from **Devicectr** Controller
};
I want read the $scope.ActiveDevice value of Devicectr controller from PreviewCtr controller. How i can do it