i wrote a small controller where i declare a variable with var keyword which is not in scope. does it means that is private in scope ? see my code.
<div ng-app="myApp" ng-controller="myCtrl">
{{test}}
</div>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
var test='test hello';
$scope.Operantion = 'hello';
$scope.GetData = function () {
abc();
};
function abc()
{
alert(test);
}
$scope.GetData();
});
the var test variable should be consider as private variable ?
if i declare a function with just function xxx() then it should be consider as private function. i am new in angular. so when testing code then many question is coming to my mind. so please guide me. thanks