Create new row with input in table when hit enter

-1

I'm creating a table using AngularJS and Bootstrap. I would like to know how do I add a new line by reaching the end and pressing the enter key?

    
asked by anonymous 09.08.2018 / 13:59

1 answer

0

The important thing is to get the code of the enter button and then create the new line inside the array

$scope.addline = function ($event) {
    debugger

    if (event.keyCode == 13) {
        var algo = {};
        for (i = 0; i < $scope.etc.Fields.length; i++) {

            algo["seu array"] = ""

        }

        $scope.myArrayData.push(algo);

    }
}
    
09.08.2018 / 20:11