में एनजी-अक्षम बटन को पुनः सक्षम करने के लिए मैं AngularJS के लिए नौसिखिया हूं। मैंने फ़ील्ड के साथ एक फॉर्म बनाया है जो डिफ़ॉल्ट रूप से ng-disabled
का उपयोग करके अक्षम कर दिया गया है। जब मैं <button>
पर क्लिक करता हूं, तो मैं इन फ़ील्ड को फिर से सक्षम करना चाहता हूं।एंगुलर जेएस
एचटीएमएल
<form class="form-horizontal" role="form" ng-submit="edit_setting()" ng-controller="ExchangeController">
<div class="form-group">
<label>Name</label>
<div class="col-sm-6">
<input type="text" class="form-control" ng-model="exchange_dt.name" ng-disabled="true">
</div>
</div>
<div class="form-group">
<label>Host Name</label>
<div class="col-sm-6">
<input type="text" class="form-control" ng-model="exchange_dt.host_name" required ng-disabled="true">
</div>
</div>
<div class="form-group">
<label>Address</label>
<div class="col-sm-6">
<input type="text" class="form-control" ng-model="exchange_dt.address" ng-disabled="true">
</div>
</div>
</form>
नियंत्रक
function ExchangeController($scope, $http, $cookieStore, $location) {
var edit_exchange_setting = "https://pvbp.com/api/settings.html?contactid=292351&exchange_id=7124&clearinghouseid=1&token=e5349652507c0esae86d50fdbdc53222cf97&page=view";
$http.get(edit_exchange_setting).success(function(response){
$scope.exchange_dt.exchange_name = response.name;
$scope.exchange_dt.exchange_host_name = response.host_name;
$scope.exchange_dt.exchange_last_processed_date = response.address;
});
$scope.edit_exchange_setting_click = (function(){
// how can i make the fields re enable here
});
}
नियंत्रक में
यहाँ एक डेमो http://fiddle.jshell.net/mnj0tdmd/ –
यह काम किया है। धन्यवाद @ के। टोरेस – Shareer
आपकी मदद करने में प्रसन्नता :) –