<!--

    Copyright (c) 2015-2018 Red Hat, Inc.
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<ng-form name="recipeEditorController.form" class="build-stack-recipe-editor">

  <textarea ui-codemirror="recipeEditorController.editorOptions"
            ng-model-options="{ allowInvalid: true }"
            ng-model="recipeContent"></textarea>

  <che-input che-form="recipeEditorController.form"
             che-name="validator"
             type="hidden"
             ng-model="recipeEditorController.recipeContent"
             custom-validator="recipeEditorController.isRecipeValid()"
             required>
    <div class="error-message">
      <div ng-message="required"
           ng-if="recipeEditorController.isFormDirty">The recipe is required.</div>
      <div ng-message="customValidator"
           ng-if="recipeEditorController.isFormDirty">{{recipeEditorController.recipeValidationError}}</div>
    </div>
  </che-input>

</ng-form>
