ngForm
入力要素をディレクティブにラップする角度のある方法はありますか? (ngFormを使用する必要があります。これはasp.netフォームです)
angular.module('app',[])
.controller('formCtrl', function($scope){
$scope.formFields;
$scope.model={
"text": 'simple text',
"number": 1,
"textarea": 'lsadij isdajo\n dasjojoisajijsdaojsdaio jioasdj'
};
$scope.getNgFormInputs = function(e){
$scope.formInfo = $scope.myFrm
$scope.formFields = angular.noop //??? is it possible to get wrapped inputs?
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
<div ng-app="app">
<div ng-controller="formCtrl">
<div ng-bind="model.text"></div>
<div ng-bind="model.number"></div>
<pre ng-bind="model.textarea"></pre>
<ng-form name='myFrm'>
<input type="text" ng-model="model.text"><br>
<input type="text" ng-model="model.number"><br>
<textarea ng-model="model.textarea"></textarea><br>
<button ng-click="getNgFormInputs($event)" role="submit">Save</button>
</ng-form>
{{formInfo}}<hr>
{{formFields}}
</div>
</div>
Tks