         controller = ['$scope', '$log', '$http', '$timeout', ($scope, $log, $http, $timeout) ->
             $log.log('Beginning of ruleSelector directive controller')
 
-            @node.ruleTypes = ['Schedule', 'Time of Day', 'Event']
-
-            @node.updateRuleTypes = () ->
-                $log.log('Updating rule types!')
+            self = this
+
+            @ruleTypes = ['Schedule', 'Time of Day', 'Event']
+            @ruleType = @ruleTypes[0]
+
+            @daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
+
+            @hoursInDay = (i for i in [1..24])
+            @hourInDay = @hoursInDay[0]
+
+            @minutesInDay = [0, 15, 30, 45]
+            @minuteInDay = @minutesInDay[0]
+
+            @updateRuleTypes = () ->
+                $log.log('Updating rule types')
+                $log.log(" - rule type is #{@ruleType}")
+            @updateRuleTypes()
+
+            @addRule = () ->
+                $log.log('Adding the rule')
+            @addRule()
         ]
         return {
             bindToController: {
-                node: '=node'
+                node: '='
+                ruleTypes: '='
+                ruleType: '='
+                updateRuleTypes: '&'
+                addRule: '&'
             }
             controller: controller
-            controllerAs: 'ruleselect'
+            controllerAs: 'rselect'
             restrict: 'E'
             scope: {}
             template: template

                </div>
                <div class="small-4 columns">
                  <label>Rule Type</label>
                  <select ng-options="type for type in node.ruleTypes"
                          ng-model="ruleType"
                          ng-change="updateRuleTypes()"
                  / >
                </div>
                <div class="small-4 columns">
                  <button type="submit" class="btn btn-default">Add</button>
                </div>
              </div>
            </form>


    app.directive('ruleSelector', () ->
        template = '''
            <form role="form" ng-submit="addRule()">
              <h1>Add a rule</h1>
              <div class="row">
                <div class="small-4 columns">
