json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Controller vm.schema is visible in view but not show the angular-schema-form . #885

Closed mss-parveensachdeva closed 7 years ago

mss-parveensachdeva commented 7 years ago

I'm using angular-schema-form with following version :- angular: 1.3.15 angular-sanitize: 1.3.15 angular-animate.min: 1.3.15

I setup the angular-schema-from with following controller code:-

vm.schema= {
  "type":"object",
  "properties":{
    "name":{
      "type": "string", "title": "Timeout Name", "readOnly": true
    },
    "timeout_list": {
      "type": "object",
      "properties": {
        "delivery_staus":{
          "type": "boolean",
          "title": "Delivery Status",
          "default": true,
          "readOnly": true
        },
        "delivery_count": {
          "type":"number",
          "title":"Delivery Count",
          "readOnly":true
        },
        "delivery_due":{
          "type":"string",
          "title":"Delivery Due",
          "readOnly":true
        },
        "delivery_user_ids": {
          "type":"string",
          "title":"Delivery users",
          "readOnly":true
        },
        "deliver_via":{
          "type": "string",
          "title": "Delivery Via",
          "enum": [ "App","email" ],
          "readOnly": true
        },
        "delivery_task_id":{
          "type": "string",
          "title": "Delivery task",
          "readOnly": true
        },
        "message_id":{
          "type": "string",
          "title": "Message Id",
          "readOnly": true
        },
        "from_user_id": {
          "type": "string",
          "title": "From user",
          "readOnly": true
        }
      }
    }
  }
} ;
vm.from = [
  "*",
  {
    type: "submit",
    title: "Save", 
    readonly:true
  }
]
vm.model = {};

I used the following code bind values in to view i.e `EC.Schema, {{EC.schema}} screenshort

` EC.schema is show in view but the dynamic form is not showing. I even try the following code but didn't get success i.e `$scope.$broadcast('schemaFormRedraw'); ` For debugging purpose I just open the 'schema-form.js' and add `console.log('scope.schema', scope.schema)`. I console.log prints the scope.schema = undefined. I also added a screen-short along with this issue which show the EC.schema value is shown on view but passed to `sf-schema` directive. I tested this with 4 types of Json-schema it works well with one schema out of 4 json schema. You can guys plz check and let me know what I'm missing or did wrong while implementing angular-schema-from . Thanks
Anthropic commented 7 years ago

@mss-parveensachdeva no one can really help you with the amount of information provided, you need to provide a demo (plunker). Please re-open when you have made one to link to. Also include the details of which version of angular-schema-form and the bootstrap decorator you are using.

mss-parveensachdeva commented 7 years ago

Hi @Anthropic , Thanks for your reply . I solved this issue :)