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

时间:2017-08-07 14:41:23

标签: 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";
}])

1 个答案:

答案 0 :(得分:1)

您的代码运行正常。没有flash插件,它在下面工作正常。检查是否有任何css属性掩盖了你的身体。并确保包含闪存的所有依赖项。

&#13;
&#13;
Dim AccountsListLength As Integer
Dim AccountsLength As Integer
Dim CurrentAccount As String
Dim SearchISIN As String
Dim CurrentAccountPage As Range
Dim FoundISIN As Range
Dim i As Integer

SearchISIN = Worksheets("Search").Range("SearchISIN").Value
AccountsListLength = (Worksheets("DataSheet").Range("AccountList").Count)
AccountsLength = AccountsListLength - 1
For i = 0 To AccountsLength - 1

    CurrentAccount = Worksheets("DataSheet").Range("AccountList")(i + 2)
    Set CurrentAccountPage = Worksheets(CurrentAccount).UsedRange
    Set FoundISIN = CurrentAccountPage.Find(what:=SearchISIN, LookIn:=xlValues, _                 
        LookAt:=xlPart, MatchCase:=False)


    If Not FoundISIN Is Nothing Then

        'Do stuff

    End If
&#13;
var app = angular.module('Profileapp',[]);
app.controller('ProfileController',['$scope','$http','$window',function($scope,$http,$window) {
    $scope.username = "sachin yadav";
}])
&#13;
&#13;
&#13;