Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using this https://github.com/Textalk/angular-schema-form plugin to generate my form will not display .I study all documentation and add all js required i didn't get any error but it not display why ? http://plnkr.co/edit/FO5iEs6ulmP3aR0PW4nt?p=preview

<!DOCTYPE html>
<html >

  <head>
    <link data-require="[email protected]" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
    <script data-require="angular.js@*" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script>
    <script data-require="[email protected]" data-semver="0.10.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.10.0.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
    <script src="https://dl.dropboxusercontent.com/s/8fq4c4t7jct4w4h/schema-form.js?m="></script>
        <script src="https://dl.dropboxusercontent.com/s/unk0id7tmc9w0mm/angular-sanitize.js?m="></script>
<script src="https://dl.dropboxusercontent.com/s/icrciconaesuw29/tv4.js?m="></script>
<script src="https://dl.dropboxusercontent.com/s/rk0dfetihiqs7bi/ObjectPath.js"></script>




  </head>

  <body>
<div ng-controller="FormController">
    <form sf-schema="schema" sf-form="form" sf-model="model"></form>
</div>
<script>
  function FormController($scope) {
  $scope.schema = {
    type: "object",
    properties: {
      name: { type: "string", minLength: 2, title: "Name", description: "Name or alias" },
      title: {
        type: "string",
        enum: ['dr','jr','sir','mrs','mr','NaN','dj']
      }
    }
  };

  $scope.form = [
    "*",
    {
      type: "submit",
      title: "Save"
    }
  ];

  $scope.model = {};
}
    </script>
  </body>

</html>
share|improve this question
    
taking a look :) –  khakiout 2 days ago
    
thanks please validate ..just take 3 field one text , number of email –  user2535959 2 days ago
    
@khakiout do you get anything ..? –  user2535959 2 days ago

1 Answer 1

The problem was the javascript plugins included were not in a proper order.

Also use angular.module() to initialize the controller.

JS:

    angular.module('test',['schemaForm']).controller('FormController', function($scope,$http){
   $scope.schema = {
    type: "object",
    properties: {
      name: { type: "string", minLength: 2, title: "Name", description: "Name or alias" },
      title: {
        type: "string",
        enum: ['dr','jr','sir','mrs','mr','NaN','dj']
      }
    }
  };

  $scope.form = [
    "*",
    {
      type: "submit",
      title: "Save"
    }
  ];

  $scope.model = {};
})

Demo

share|improve this answer
    
thanks for answer..!! can we validate form using blur or save button .. –  user2535959 2 days ago
    
Actually I want to make form from json with validation..,may be different from email some other like "server url " I need to check this using save "button" click or on blur .. –  user2535959 2 days ago
    
Found the solution to your problem through the documentation. Also here the example. See if this helps –  karan3112 2 days ago
1  
thanks karan ..I already found that but I am too confused which plugin is better .this current one one or this one github.com/McNull/angular-febworms –  user2535959 2 days ago
    
both plugin able to make form using json .confuson only validation on blur as well as on submit button –  user2535959 2 days ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.