對AngularJs非常新穎,並試圖找出爲什麼我的功能完全打印出如下。功能全部打印
Hello function() { return (this.sal) * 12; }
這是我的代碼。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script type="text/javascript">
var app=angular.module("sample",[]);
app.controller("emp",function($scope){
$scope.Name="Jag";
$scope.sal="4500"
$scope.getAnnualSal = function()
{
return (this.sal) * 12;
}
});
</script>
</head>
<body ng-app="sample">
<div ng-controller="emp">
Hello {{getAnnualSal}}
</div>
</body>
</html>