模式形式“fieldset”不在架构表单标记中生成 [英] Schema form "fieldset" is not generate in schema form tag

查看:77
本文介绍了模式形式“fieldset”不在架构表单标记中生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用架构表单angular js mvc应用程序,想要使用json架构生成表单或模板,但它在我的应用程序中不起作用,我在我的控制器中注入了Schema-Form并使用模式形成了标签但是它不起作用,还包括架构表格的js文件....有时它的工作正常但是在项目第二次构建之后它没有显示任何东西......

这是输出我我正在生成html



< bootstrap-decorator form =schemaForm.form [0]class =ng-scope>< bootstrap-decorator form =schemaForm.form [1]class =ng-scope>< bootstrap-decorator form =schemaForm.form [2]class =ng-scope>



使用form和bootstrap-decorator获取这个html生成的标签,但是没有生成字段集

模式表格标签



我尝试了什么:



< script src =〜/ Contents / js / external / angular- sanitize.min.js>< / script>

< script src =〜/ Contents / js / external / tv4.js>< / script>

< script src =〜/ Contents / js / external / ObjectPath .js>< / script>

< script src =〜/ Contents / js / external / schema-form.js>< / script>

< script src =〜/ Contents / js / external / bootstrap-decorator.js>< / script>



i已包含这些文件在主表单上还在控制器中注入模式表单

之后在cshtml页面中包含表单标签





@ {

布局= null;

}







< div ng-app =EMRProtocolListModuleng-controller =EMRProtocolListController>

< form sf-schema =schemasf-form = formsf-model =model>< / form>

< / div>





之后为绑定架构表单编写一个示例控制器代码







'使用严格;



angular.module('EMRProtocolListModule',['ngSanitize','schemaForm'])

.controller('EMRProtocolListController',函数($ scope){

$ scope.schema = {

类型:对象,

属性:{

name:{type:string,minLength:2,title:Name,description:name or alias},

title:{

输入:string,

enum:['dr','jr','sir','mrs','mr','NaN','dj']

}

}

};



$ scope.form = [

*,

{

类型:提交,

标题:保存

}

];



$范围。 model = {};

});

i am working on schema form angular js mvc application,want to generate a form or template using json schema but its not working in my application , i have inject a "Schema-Form" in my controller and form tag with schema but its does not work ,also include js file for schema forms....some time its working proper but after project second build its does not show anything......
this is the output i am getting in html generated

<bootstrap-decorator form="schemaForm.form[0]" class="ng-scope"><bootstrap-decorator form="schemaForm.form[1]" class="ng-scope"><bootstrap-decorator form="schemaForm.form[2]" class="ng-scope">

getting this html generated tags with form and bootstrap-decorator but "field set is not generated"
in schema form tag

What I have tried:

<script src="~/Contents/js/external/angular-sanitize.min.js"></script>
<script src="~/Contents/js/external/tv4.js"></script>
<script src="~/Contents/js/external/ObjectPath.js"></script>
<script src="~/Contents/js/external/schema-form.js"></script>
<script src="~/Contents/js/external/bootstrap-decorator.js"></script>

i have inculde these files on master form also inject a "Schema-form" in controller
after that inculde a form tag in cshtml page


@{
Layout = null;
}



<div ng-app="EMRProtocolListModule" ng-controller="EMRProtocolListController">
<form sf-schema="schema" sf-form="form" sf-model="model"></form>
</div>


after that write a sample controller code for bind schema form



'use strict';

angular.module('EMRProtocolListModule', ['ngSanitize', 'schemaForm'])
.controller('EMRProtocolListController', function ($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 = {};
});

推荐答案

范围){
scope) {


scope.schema = {

类型:对象,

属性:{

name:{type:string,minLength: 2,标题:名称,描述:名称或别名},

标题:{

类型:string,

枚举:['dr','jr','sir','mrs','mr','NaN','dj']

}

}

};


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 = [

*,

{

类型:提交,

标题:保存

}

];


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


这篇关于模式形式“fieldset”不在架构表单标记中生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆