Unable to get the value of $scope when in function in angular js
Here how it looks like
module.controller('MainController', function($scope, $window, $rootScope, checkConnection) {
$scope.online = false;
$scope.deviceReady = false;
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
checkConnection.checkCon($scope);
$scope.checkInetNetwork = $rootScope.checkInetNetwork;
if ($rootScope.checkInetNetwork == "true") {
$scope.online = true;
} else {
$scope.online = false;
}
}
});
I am not able to figure out why <p ng-show="online">ThAnk You Thank you</p> why this is not displaying. When even i am making it TRUE. Out side this function it works like charm.
Any solution?