我試圖將數據綁定到HTML頁面,如下所示,但數據不具有約束力。將控制器數據綁定到angularjs中的html頁面
<body ng-app="Profileapp" ng-controller="ProfileController" >
{{username}}
</body>
我控制器
var app = angular.module('Profileapp',['ngFlash']);
app.controller('ProfileController',['$scope','$http','$window','Flash',function($scope,$http,$window,Flash) {
$scope.username = "sachin yadav";
}])
請你檢查錯誤控制檯? –
你是否包含了所有依賴的js文件,包括ngFlash的文件? – Vivz
控制檯中沒有錯誤。 –