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