Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Forms in Angular.js

I've been studying Angular.js for my term exams and was working on the following code related to Angular.js forms.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular-csp.css">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
    <title>Practical 12</title>
</head>
<body>
    
    <div ng-app="formApp" ng-controller="formCtrl">
        <form name="festForm" novalidate ng-submit="sendForm(x)">
            <h2>Registration form for tech event</h2>
            <table>
                <tr>
                    <td>
                        <label for="fname">First Name</label>
                        <input type="text" name="fname" id="fname" ng-model="x.fname" >
                        <!-- <span ng-show="festForm.fname.$error.required">*enter first name</span> -->
                    </td>
                </tr>
                <tr>
                    <input type="submit" value="SUBMIT">
                </tr>
            </table>
        </form>

        <p>{{userdata}}</p>
    </div>
    <script>
        var app=angular.module("formApp",[])
        app.controller("formCtrl",function($scope){
            $scope.userdata="";
            $scope.sendForm=function(fest){
                $scope.msg="Form Validated"
                $scope.userdata=angular.copy(fest);
                console.log(fest)
            }
            
        })
    </script>
</body>
</html>

Following is the output of the following code

enter image description here I am not able to understand the flow how my argument fest passed in the sendform function gets converted into javascript object.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda