将控制器数据绑定到angularjs中的html页面

将控制器数据绑定到angularjs中的html页面,angularjs,Angularjs,我试图将数据绑定到HTML页面,如下所示,但数据没有绑定 <body ng-app="Profileapp" ng-controller="ProfileController" > {{username}} </body> 你的代码运行良好。在没有flash插件的情况下,它可以正常工作。检查是否有任何css属性遮挡了您的身体。还要确保包含了flash的所有依赖项 var-app=angular.module('Profileapp',[]); app.cont

我试图将数据绑定到HTML页面,如下所示,但数据没有绑定

<body ng-app="Profileapp" ng-controller="ProfileController" >
    {{username}}
</body>

你的代码运行良好。在没有flash插件的情况下,它可以正常工作。检查是否有任何css属性遮挡了您的身体。还要确保包含了flash的所有依赖项

var-app=angular.module('Profileapp',[]);
app.controller('ProfileController',['$scope','$http','$window',函数($scope,$http,$window){
$scope.username=“sachin yadav”;
}])

{{username}}

请检查控制台是否有错误?您是否包含了所有相关的js文件,包括ngFlash的文件?控制台中没有错误。我已经包含了所有用于angular Flash的文件。您遇到了什么错误?上面的代码段工作正常,必须从代码中的其他地方生成。检查你的控制台,如果有任何错误,我试图进入ejs文件的工作文件,但不是在html。什么是你的应用程序引擎。是ejs还是html?我的意思是从后端?是html,但现在我使用ejs,所以我把它改为ejs。所以它将与ejs一起工作,将它改回html,并检查它是否工作
var app = angular.module('Profileapp',['ngFlash']);
app.controller('ProfileController',['$scope','$http','$window','Flash',function($scope,$http,$window,Flash) {
    $scope.username = "sachin yadav";
}])