I'm newbie to AJs, and I'm trying to share $scope.showdropdown directive with another controller so that the second controller can call this directive in its body.
this is what I want:
.controller('firstCtrl', function($scope){
$scope.showdropdown = false; // this is part of this controller
})
.controller('secondCtrl', function($scope){
if(username and pass correct){
$scope.showdropdown = true; // I want to call this here, but I can't do it bcoz its not part of the same controller!!!
}
})
I tried all sorts of thing, factory etc. and had no luck Can someone show me how can this be done please!