0

My code showing code as output please help

My code showing code as output please help

My code showing code as output please help

Output showing : you are entering : {{student.fullName()}}

<!doctype html>
<html>
<head>
  <title>Angular js Controller Example.</title>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
 </head>
<body>
  <div ng-app="myApp" ng-controller="studentController">
     Enter first name:<input type="text" ng-model="student.firstName">
     Enter last name: <input type="text" ng-model="student.lastName"></br>
     <br>
     <p>you are entering : {{student.fullName()}}</p>
  </div>
  <script> 
     function studentController($scope) { 
        $scope.student = { 
        firstName: "Joe", 
        lastName: "Doe", 
        fullName: function() { 
        var studentObject; 
        studentObject = $scope.student; 
        return studentObject.firstName + ' ' + studentObject.lastName; 
            } 
        }; 
     } 
   </script> 
  </body>
</html>
jidajez
  • 41
  • 4
  • *His code showing code as output please help!* – dfsq May 07 '17 at 10:22
  • Check console you must seeing this error *Angularjs Uncaught Error: [$injector:modulerr]*, the reason is you haven't declare a angular module and didn't register any controller with it. Please check duplicate answer. that will clear your concept :) – Pankaj Parkar May 07 '17 at 10:23
  • There is some issue with AngularJS 1.3.14 downgrade it to 1.3.13 works fine, I'd prefer you to use angular 1.2.27 AngularJS 1.5.X, Which is more stable version & latest release of AngularJS. I have tried with 1.6xx – jidajez May 07 '17 at 10:24
  • @jidajez so you mean it didn't worked with angular 1.6.X ? – Pankaj Parkar May 07 '17 at 10:35

0 Answers0