Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!