我的角模式表单错了内联的图标,它们显示在页面的右上角:图片。
这个应用程序是用yeoman构建的,使用的是发电机角度。
html:
<div class="login-container">
<form name="myForm"
sf-schema="schema"
sf-form="form"
sf-model="model"
ng-submit="onSubmit(myForm)"></form>
</div>ts:
angular.module('playgroundApp')
.controller('FormCtrl', ['$scope', function($scope) {
$scope.schema = {
"type": "object",
"title": "Types",
"properties": {
"string": {
"type": "string",
"minLength": 3
},
"integer": {
"type": "integer"
},
"number": {
"type": "number"
},
"boolean": {
"type": "boolean"
}
},
"required": [
"number"
]
};
$scope.form = [
"*",
{
"type": "submit",
"title": "OK"
}
];
$scope.model = {};
$scope.onSubmit = function(form) {
// First we broadcast an event so all fields validate themselves
$scope.$broadcast('schemaFormValidate');
// Then we check if the form is valid
if (form.$valid) {
// ... do whatever you need to do with your data.
}
}
}]);我试图搜索指令之间的冲突,不幸的是,我无法在普鲁克尔中再现这种行为。
bower.json:
{
"name": "playground",
"version": "0.0.0",
"dependencies": {
"angular": "^1.5.3",
"bootstrap": "^3.2.0",
"angular-animate": "^1.3.0",
"angular-cookies": "^1.3.0",
"angular-resource": "^1.3.0",
"angular-route": "^1.3.0",
"angular-sanitize": "^1.3.0",
"angular-touch": "^1.3.0",
"angular-ui-grid": "~3.1.1",
"angular-ui-router": "~0.2.15",
"ngstorage": "~0.3.9",
"angular-ui-layout": "~1.3.0",
"angular-bootstrap": "~0.14.3",
"moment": "~2.10.6",
"lodash": "~3.10.1",
"angular-wizard": "~0.5.5",
"ui-select": "angular-ui-select#~0.16.0",
"select2": "~3.4.5",
"angular-flash-alert": "~2.2.5",
"angular-gantt": "^1.2.13",
"angular-strap": "^2.3.7",
"angular-schema-form": "~0.8.13",
"angular-ui-tree": "~2.15.0",
"components-font-awesome": "~4.6.1",
"woodman": "~1.1.0",
"angular-ui-bootstrap": "~1.0.3",
"angular-picklist": "*",
"jquery-ui": "~1.11.4",
"angular-schema-form-bootstrap": "~0.2.0",
"angular-schema-form-datepicker": "~0.4.0",
"jquery": "~3.0.0"
},
"devDependencies": {
"angular-mocks": "^1.3.0",
"ui-select": "angular-ui-select#~0.16.0"
},
"appPath": "app",
"moduleName": "playgroundApp",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
},
"resolutions": {
"lodash": "~3.10.1",
"angular-mocks": "^1.3.0"
}
}更新:忽略此问题4个月。面对它,我今天安装了最新版本的角模式表单和angular-schema-form-bootstrap,问题消失了。
发布于 2017-02-03 12:49:17
对于那些图标仍然有问题的人,可以禁用它们添加到表单定义中的每个字段:'feedback': false,如docs 这里中所述。
也许不是最好的解决方案,但如果你没有图标的话会有帮助。
https://stackoverflow.com/questions/37831895
复制相似问题