Welcome to JS Bin
Load cached copy from
 
<html>
   
   <head>
    <title>Angular MVC Example</title>
    <script src = 
     "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
    </script>
   </head>
   
   <body>
      <h2>AngularJS MVC Example</h2>
      
      <div ng-app = "testApp" ng-controller = "appController">
         Enter first name: 
         <input type = "text" ng-model = "student.firstName">
         <br><br>
         Enter last name: 
         <input type = "text" ng-model = "student.lastName">
         <br><br>
         
        Entered Value: {{student.fullName()}}
      </div>
      
      <script>
         var mainApp = angular.module("testApp", []);
         
         mainApp.controller('appController', function($scope) {
            $scope.student = {
               firstName: "Vivek",
               lastName: "Solenki",
               
               fullName: function() {
                  var studentObject;
                  studentObject = $scope.student;
                  return studentObject.firstName + " "
                                + studentObject.lastName;
               }
            };
         });
      </script>
      
   </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x