0
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl", function($scope) {
$scope.users=[
{name:'',email:'',course:'',file:''}
]
$scope.value=function(){
$scope.users=[{
name:'abc',
email:'[email protected]',
course:'angular js,css',
file:'abc.jpg';
}];
}
});
</script>
<div ng-app="myApp" ng-controller="myCtrl">
<button type="button" ng-click="value()">To get values</button>
<div ng-repeat="user in users">
<input type="text" ng-model="user.name">
<input typee="text" ng-model="user.email">
<select ng-model="user.course" multiple>
<option value="html">html </option>
<option value="css">css</option>
<option value="angular js">angular js</option>
</select>
<input type="file" ng-model="user.file">
</div>
</div>
我是新來的角JS我想要的文件名分配給輸入類型的文件單擊按鈕時得到的值時,分配NG-模型的輸入類型的文件我想只分配值並顯示輸入類型文件的值以及如何將多個選擇框綁定爲ng-model點擊按鈕
爲了固定選擇問題只是使從'當然一個小的變化: '角JS,css''到'當然:[' HTML」, 'CSS'],' –
張貼代碼和用於輸入 –