'use strict';

angular.module('myApp.view1', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view1', {
    templateUrl: 'view1/view1.html',
    controller: 'View1Ctrl'
  });
}])

.controller('View1Ctrl', ['$scope', 'timeSlotService', function($scope, timeSlotService) {

	// inject time object?

	// test output? Against scope?

	$scope.timeSlotOptions = [
    { label: '06:30am', value: '06:30' },
    { label: '07:00am', value: '07:00' }
  ];

	$scope.timeSlotSelected = $scope.timeSlotOptions[0];

}])

.factory('timeSlotService', ['$window', 'currentTimeService', function(win, currentTimeService) {
  var timeSlotServiceInstance;

  // factory function body that constructs shinyNewServiceInstance

  win.console.log(currentTimeService);

  return timeSlotServiceInstance;
}])

.factory('currentTimeService', ['$window', function(win) {
  return new Date(); // easier way to inject in a date?
}])

;


'use strict';

angular.module('myApp.view1', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view1', {
    templateUrl: 'view1/view1.html',
    controller: 'View1Ctrl'
  });
}])

.controller('View1Ctrl', ['$scope', function(sc) {

	sc.timeSlotOptions = [
    { label: '06:30am', value: '06:30' },
    { label: '07:00am', value: '07:00' }
  ];

	sc.timeSlotSelected = sc.timeSlotOptions[0];

	//this.slots = ["06:00am", "06:30am", "07:00am"];

	// create and initialise function that is called on page load

	// generate an array of time slots and bind to a model


}]);

//var slots = ["06:00am", "06:30am", "07:00am"];

--- 
+++ 
@@ -9,22 +9,34 @@
   });
 }])
 
-.controller('View1Ctrl', ['$scope', function(sc) {
+.controller('View1Ctrl', ['$scope', 'timeSlotService', function($scope, timeSlotService) {
 
-	sc.timeSlotOptions = [
+	// inject time object?
+
+	// test output? Against scope?
+
+	$scope.timeSlotOptions = [
     { label: '06:30am', value: '06:30' },
     { label: '07:00am', value: '07:00' }
   ];
 
-	sc.timeSlotSelected = sc.timeSlotOptions[0];
+	$scope.timeSlotSelected = $scope.timeSlotOptions[0];
 
-	//this.slots = ["06:00am", "06:30am", "07:00am"];
+}])
 
-	// create and initialise function that is called on page load
+.factory('timeSlotService', ['$window', 'currentTimeService', function(win, currentTimeService) {
+  var timeSlotServiceInstance;
 
-	// generate an array of time slots and bind to a model
+  // factory function body that constructs shinyNewServiceInstance
 
+  win.console.log(currentTimeService);
 
-}]);
+  return timeSlotServiceInstance;
+}])
 
-//var slots = ["06:00am", "06:30am", "07:00am"];
+.factory('currentTimeService', ['$window', function(win) {
+  return new Date(); // easier way to inject in a date?
+}])
+
+;
+
Set up services to contain logic and inject in date wrapper
