how can I call/access $scope.mydata
from another method in the same controller in Angularjs?
My scenario is
.controller("myCtryl", function($scope, $http) {
$scope.functionA = function(){
$scope.data = "some data";
}
$scope.functionB = function(){
//access $scope.data here//
}
}
functionA
? – Alexis King Jan 25 '15 at 18:39$scope.data
in the other function before the previous function sets the value on it asyncronously. Currently your question is too unclear for us to provide a definitive answer for your issue, – PSL Jan 25 '15 at 18:40