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: <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  
  <%
  final String baseHref = Util.calculateUrlBase(request);
  final String report = request.getParameter("report");
  final String resourceId = request.getParameter("resourceId");
  String[] requiredParameters = new String[] {"report", "resourceId"};
  
  if (report == null) {
      throw new MissingParameterException("report", requiredParameters);
  } else if (resourceId == null) {
      throw new MissingParameterException("resourceId", requiredParameters);
  }
  
  pageContext.setAttribute("report", report);
  pageContext.setAttribute("resourceId", resourceId);
  %>
  
  <jsp:include page="/includes/bootstrap.jsp" flush="false" >
  