我对动态生成的输入有疑问。 我怎样才能得到它们的值?

<p ng-repeat="(key, value) in selectedTemplate.attributes.Params.attributes"> 
    {{key}} : <tr><input ng-model="params[key]" type="text" placeholder="{{value}}" > 
</p> 
 
//attributes are like this 
"attributes": { 
    "End Date": "java.sql.Timestamp", 
    "Containers": "java.lang.Object", 
    "Begin Date": "java.sql.Timestamp" 
} 

谢谢。

请您参考如下方法:

只需声明 $scope.params = {}在你的 Controller 中。 之后您可以通过以下方式访问这些值: $scope.params['End Date'] , $scope.params['Containers'] , $scope.params['Begin Date']


评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!