Mohammad Azeem
Mohammad Azeem

Reputation: 43

Angular Schematics Prompt type "confirmation"

Requirement

I want to use prompt type "confirmation" in schematics and based on the "Yes"/ "No" I want to hide the next question. As shown in the below schema.json file there is one confirmation and one list of multiselect values. I want to hide that list if the user selects "No". How to achieve ?

Schema.json


{
    "$schema": "http://json-schema.org/schema",
    "id": "Schemantics",
    "title": "Generator",
    "type": "object",
    "properties": {
      "confirmation": {
        "description": "Folder location?",
        "type": "string",
        "x-prompt": {
          "message": "Would you like to select component?",
          "type": "confirmation"
        }
      },
      "components": {
        "description": "Select components",
        "type": "array",
        "x-prompt": {
          "message": "Select components",
          "type": "list",
          "multiselect": true,
          "items": [
            "HouseDetails", 
            "UserDetails",
            "Uploads"
          ]
        }
      }
    }
  }

As per the comment given by @jeroenouw I have tried the below code and it is still not working


{
    "$schema": "http://json-schema.org/schema",
    "id": "Schemantics",
    "title": "Generator",
    "type": "object",
    "properties": {
      "confirmation": {
        "description": "Folder location?",
        "type": "object",
        "x-prompt": {
          "message": "Would you like to select component?",
          "type": "confirmation",
          "items": {
            "components": {
              "description": "Select components",
              "type": "array",
              "x-prompt": {
                "message": "Select components",
                "type": "list",
                "multiselect": true,
                "items": [
                  "HouseDetails", 
                  "UserDetails",
                  "Uploads"
                ]
              }
            }
          }
        }
    }
  }
}

Upvotes: 0

Views: 643

Answers (0)

Related Questions