i want to start background service when app is launch and after restart the service is automatically start
document.addEventListener('deviceready', function() {
   myService = cordova.plugins.myService;;
  upload();
},
true);
i want to start background service when app is launch and after restart the service is automatically start
document.addEventListener('deviceready', function() {
   myService = cordova.plugins.myService;;
  upload();
},
true);
 
    
    you will need this service injected to your controller
.controller('myCtl', myCtl);
function myCtl(LoginService) {
   $scope.username = null;
   $scope.password = null; 
   $scope.doLogin = LoginService.loginUser;
}
and then in your view
<div ng-controller="myCtl">
   ...
   <input type="text" ng-model="username">
   <input type="password" ng-model="password">
   <button type="button" ng-click="doLogin(username, password)">
      Login
   </button>
   ...
</div>
