This is the main modal code:
<div ng-controller="CorporatePackageDetailsOpen20">
<div class="modal-header">
<h3 class="modal-title">Package Detail</h3>
</div>
<div class="modal-body" id="packagedetails">
</div>
<div class="modal-footer">
<a class="btn m-b-xs w-xs btn-info" ng-click="getFormForupdate()" style="width:125px !important;">Update Package</a>
<button class="btn m-b-xs w-xs btn-danger" ng-click="cancel()">Close</button>
</div>
<div id="addpackageform"></div>
</div>
Dynamically HTML is going to append to addpackageform div which is in above code. In that, which is dynamically created HTML, i have one button, here is the HTML code for that button
:
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button type="button" ng-click="assingSinglePackageToOperator()" class="btn btn-default btn-info">Add</button>
</div>
</div>
In my controller.js
file, i have code:
app.controller('CorporatePackageDetailsOpen20', function ($scope) {
$scope.assingSinglePackageToOperator = function () {
var iPackageId = $('#iPackageId').val();
var dStartDate = $('#dStartDate').val();
var dEndDate = $('#dEndDate').val();
var id = $scope.id;
console.log(iPackageId);
console.log(dStartDate);
console.log(dEndDate);
return false;
};
});
When i click on Add
button, it is not going to console the data.