anchor.diff:      </div> <!-- col-md-12 -->
   </div> <!-- row -->
   
  +
   <script>
       function getBaseHref() {
           return "<%= baseHref %>";
       }
   
       var app = angular.module("forecast", []);
  +
  +    var INTEGER_REGEXP = /^\-?\d+$/;
  +    app.directive('integer', function() {
  +      return {
  +        require: 'ngModel',
  +        link: function(scope, elm, attrs, ctrl) {
  +          ctrl.$validators.integer = function(modelValue, viewValue) {
  +            if (ctrl.$isEmpty(modelValue)) {
  +              // consider empty models to be valid
  +              return true;
  +            }
  +
  +            if (INTEGER_REGEXP.test(viewValue)) {
  +              // it is valid
  +              return true;
  +            }
  +
  +            // it is invalid
  +            return false;
  +          };
  +        }
  +      };
  +    });
  +
  +    app.directive('greaterThanZero', function() {
  +        return {
  +          require: 'ngModel',
  +          link: function(scope, elm, attrs, ctrl) {
  +            ctrl.$validators.integer = function(modelValue, viewValue) {
  +              if (ctrl.$isEmpty(modelValue)) {
  +                return false;
  +              }
  +              return viewValue > 0;
  +            };
  +          }
  +        };
  +      });
  +
       app.controller("forecastCtrl", function($scope) {
           // Use the first div we find with the data-graph-report attribute
           $scope.graphElement = $("div[data-graph-report]").first();
  
positive.code:         };
  
          $scope.canForecast = function() {
              return $scope.metricToForecast !== null && $scope.forecastingTemplate !== null;
          };
  
          $scope.forecast = function() {
  
negative.code: 		                        <li role="presentation" class="active"><a href="#time" role="tab" data-toggle="tab">Time Span</a></li>
  		                        <li role="presentation"><a href="#stat" role="tab" data-toggle="tab">Trend and Forecast</a></li>
  		                    </ul>
  		                    <!-- Tab panes -->
  		                    <div class="tab-content">
  		                        <div role="tabpanel" class="tab-pane active" id="time">
  		                            <div class="form-group" ng-class="{'has-error': form.trainingStart.$invalid}">
  		                                <label class="col-sm-3 control-label">Training Start</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" integer min="0" ng-required="true" class="form-control" name="trainingStart" ng-model="forecastingOptions.trainingStart">
  		                                    <span class="help-block">Samples from this number of days ago will be used to train the model, but won't be shown on the graph.</span>
  		                                </div>
  		                            </div>
  
  		                            <div class="form-group" ng-class="{'has-error': form.graphStart.$invalid}">
  		                                <label class="col-sm-3 control-label">Graph Start</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" integer min="1" ng-required="true" class="form-control" name="graphStart" ng-model="forecastingOptions.graphStart">
  		                                    <span class="help-block">Samples from this number of days ago will be shown on the graph.</span>
  		                                </div>
  		                            </div>
  
  		                            <div class="form-group" ng-class="{'has-error': form.forecasts.$invalid}">
  		                                <label class="col-sm-3 control-label">Forecasts</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" integer min="1" ng-required="true" class="form-control" name="forecasts" ng-model="forecastingOptions.forecasts">
  		                                    <span class="help-block">Number of seasons to forecast.</span>
  		                                </div>
  		                            </div>
  		                        </div>
  		                        <div role="tabpanel" class="tab-pane" id="stat">
  		                            <div class="form-group" ng-class="{'has-error': form.season.$invalid}">
  		                                <label class="col-sm-3 control-label">Season</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" greater-than-zero ng-required="true" class="form-control" name="season" ng-model="forecastingOptions.season">
  		                                    <span class="help-block">Seasonality in days of the sample data. The training set must contain at least two seasons worth of data.</span>
  		                                </div>
  		                            </div>
  
  		                            <div class="form-group" ng-class="{'has-error': form.trendOrder.$invalid}">
  		                                <label class="col-sm-3 control-label">Trend Order</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" integer min="1" ng-required="true" class="form-control" name="trendOrder" ng-model="forecastingOptions.trendOrder">
  		                                    <span class="help-block">Order of the polynomial used to estimate the trend. Set to this 1 for a line or higher for a curve.</span>
  		                                </div>
  		                            </div>
  
  		                            <div class="form-group" ng-class="{'has-error': form.confidenceLevel.$invalid}">
  		                                <label class="col-sm-3 control-label">Confidence Level</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" greater-than-zero max="1" ng-required="true" class="form-control" name="confidenceLevel" ng-model="forecastingOptions.confidenceLevel">
  		                                    <span class="help-block">Level used to calculate the upper and lower confidence bounds.</span>
  		                                </div>
  		                            </div>
  		
  		                            <div class="form-group" ng-class="{'has-error': form.outlierThreshold.$invalid}">
  		                                <label class="col-sm-3 control-label">Outlier Threshold</label>
  		                                <div class="col-sm-9">
  		                                    <input type="number" greater-than-zero max="1" ng-required="true" class="form-control" name="outlierThreshold" ng-model="forecastingOptions.outlierThreshold">
  		                                    <span class="help-block">Percentile used to eliminate outliers. Outliers and missing values are automatically interpolated.</span>
  		                                </div>
  		                            </div>
  