Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
<div ng-app="mainApp" ng-controller="studentController">
    Enter first name: <input type= "text" ng-model = "student.firstName"><br/><br/>
    Enter last name: <input type= "text" ng-model = "student.lastName"><br/><br/>
    You are entering: {{student.fullName()}}
</div>
  
  
<script>
  
    var mainApp = angular.module("mainApp", []);
    
    mainApp.controller('studentController', function($scope){
        $scope.student = {
            firstName: "Mahesh",
            lastName: "Parashar",
            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
public
Bin info
roXonpro
0viewers