你好,我正在學習角度,並試圖綁定數據從模型來查看。但它沒有拋出任何錯誤。你可以幫我嗎。無法綁定來自控制器的數據進行查看。在控制檯沒有錯誤
<div ng-app ="myApp" ng-controller="emp">
Hello {{emp.name}}, I am happy that you are getting a salary of{{emp.salary}}.
</div>
var app = angular.module("myApp", []);
app.controller('emp', function(){
this.name = "John";
this.salary = 4500;
});
請找Fiddler
另一個有趣的答案。 https://stackoverflow.com/questions/11605917/this-vs-scope-in-angularjs-controllers –