无法将子组件中的格式表单中的值传递给父组件 .
所以我在review.controller.js(孩子)中有这个形式领域
$scope.fields = [
{
className: "row",
fieldGroup: [
{
fieldGroup: [
{
key: 'firstName',
type: 'horizontalInput',
name: 'First Name',
templateOptions: {
label: 'First Name',
type: 'text',
required: true,
},
}
]
}
]
}
我想传递给submit.controller.js(父)
$scope.submitApplication = function() {
var firstname = $scope.$parent.fields.guestFirstName;
}
};
我尝试使用$ scope . $ parent来检索值,但它并没有真正起作用...任何输入都将非常感谢!
1 回答
你问的问题并不是很清楚 . 无论它们内部有多少个fieldGroup,这些值都包含在模型中 .
你应该能够简单地使用: