I have designed a form in angular js with modal popup.Inside modal popup two textboxes and a button.i want to perform subtraction of two numbers.After submitting a button inside modalpopup, the Subtraction result must be shown in textbox which is designed in main form and also next row should be generated automatically with textbox and a button.The problem is after calculation the result is showing same for main form textbox as well as in automatic generated text box. i m attatching code below.can any one solve my problem?
//angular code:
var app = angular.module("myApp", []);
app.controller('myCntrl', function ($scope) {
$scope.rows = [
{
column1: 'first row',
column2: 'second column of first row',
column3: false
}
];
$scope.Addrow = function () {
alert("hi");
$scope.rows.push(
{
column1: 'row #' + $scope.rows.length,
column2: 'this is new',
column3: true
}
);
$scope.result = $scope.val - $scope.value;
//$scope.city = $scope.address;
//$scope.Name = $scope.name;
//var a = Number($scope.val);
//var b = Number($scope.value);
//$scope.sum = a - b;
//var c = $scope.sum;
//$scope.result = c;
}
});
//index.cs html
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
Modal Header
//Layout.cs html
@**@
@**@
@*for modal popup*@
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bikesh SrivastavaPosted Oct 19, 2016, 6:25 AM
manikanth mahankaliPosted Oct 20, 2016, 8:40 AM
manikanth mahankaliPosted Oct 19, 2016, 7:29 AM