Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda