角度Js功能不显示输出

时间:2017-05-07 10:20:57

标签: angularjs

我的代码显示代码作为输出请帮助

我的代码显示代码作为输出请帮助

我的代码显示代码作为输出请帮助

输出显示:您正在输入:{{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>

0 个答案:

没有答案