Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

angular classes to separate files

  • Loading branch information...
commit 948372960b8abeb9a0c0fad1407b9336011e88e8 1 parent 723f0a8
@sgrebnov sgrebnov authored
Showing with 52 additions and 6 deletions.
  1. +4 −6 www/index.html
  2. +23 −0 www/js/ngApp.js
  3. +25 −0 www/js/ngOneDriveCtrl.js
View
10 www/index.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en" ng-app="skyApp">
+<html lang="en" ng-app="app">
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
@@ -12,7 +12,7 @@
</head>
- <body ng-controller="SkyListCtrl">
+ <body ng-controller="ngOneDriveCtrl">
<div class="container">
<div>
<h1 ng-if="userName!=null" class="pull-right" >{{userName}}
@@ -39,9 +39,7 @@ <h1 ng-if="userName!=null" class="pull-right" >{{userName}}
<script src="js/skyDrive.js"></script>
<script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="js/index.js"></script>
- <script type="text/javascript">
- app.initialize();
- </script>
+ <script type="text/javascript" src="js/ngApp.js"></script>
+ <script type="text/javascript" src="js/ngOneDriveCtrl.js"></script>
</body>
</html>
View
23 www/js/ngApp.js
@@ -0,0 +1,23 @@
+(function () {
+ 'use strict';
+
+ // Module name is handy for logging
+ var id = 'app';
+
+ // Create the module and define its dependencies.
+ var app = angular.module('app', [
+ // Angular modules
+ //'ngRoute' // routing
+
+ // Custom modules
+
+ // 3rd Party Modules
+
+ ]);
+
+ // Execute bootstrapping code and any dependencies.
+ app.run(['$q', '$rootScope',
+ function ($q, $rootScope) {
+
+ }]);
+})();
View
25 www/js/ngOneDriveCtrl.js
@@ -0,0 +1,25 @@
+(function () {
+ 'use strict';
+
+ // Controller name is handy for logging
+ var controllerId = 'ngOneDriveCtrl';
+
+ // Define the controller on the module.
+ // Inject the dependencies.
+ // Point to the controller definition function.
+ angular.module('app', []).controller(controllerId, ['$scope', function($scope) {
+
+ function initialize() {
+ $scope.userName = 'John Smith';
+
+ };
+
+ function waitForDeviceReady() {
+ document.addEventListener('deviceready', initialize, false);
+ };
+
+ $scope.userName = 'Loading..';
+
+ waitForDeviceReady();
+ }]);
+})();
Please sign in to comment.
Something went wrong with that request. Please try again.