$scope中的数据未加载到动态加载html的angularjs视图中

$scope中的数据未加载到动态加载html的angularjs视图中,html,angularjs,dynamic,view,scope,Html,Angularjs,Dynamic,View,Scope,我正在一个选项卡中加载HTML。在将HTML加载到div中后,我将触发控制器。当控制器被触发时,我在控制器中有数据。该数据未在HTML视图中填充。有没有关于调用控制器或将数据加载到HTML中的建议 $('<div id = '+ createChannelTabId +'Properties'+ ' ng-controller="channelHomeCtrl" ng-bind="msg"> </div>').appendTo("#" + createChannelTa

我正在一个选项卡中加载HTML。在将HTML加载到div中后,我将触发控制器。当控制器被触发时,我在控制器中有数据。该数据未在HTML视图中填充。有没有关于调用控制器或将数据加载到HTML中的建议

 $('<div id = '+ createChannelTabId +'Properties'+ ' ng-controller="channelHomeCtrl" ng-bind="msg"> </div>').appendTo("#" + createChannelTabId);

        $('body').injector().invoke(function ($compile, $rootScope) {
                $compile($("#" + createChannelTabId + "Properties"))($rootScope);
                $rootScope.$apply();
            });
       var modalFieldProperties = $("#" + createChannelTabId + "Properties");
            modalFieldProperties.html(loadHTML("channelHome.html"));
            $("#" + createChannelTabId + "Link")[0].click();

         angular.bootstrap($("#" + createChannelTabId), ['ChannelModule']);
即使这样,数据也不会加载到HTML中

<div ng-controller="channelHomeCtrl">
<div class="infobox infobox-green" id="{{i.binDataId}}" ng-click ="setSectedValue(i)" ng-style="{ 'width' : width}" style=" margin: 5px 5px 0px 5px; padding: 2px 3px 2px 9px; height: 55px; border: 1px solid; border-radius: 8px; " ng-repeat="i in items| filter:query" >
    <div class="infobox-icon">
        <img src="../images/system/decisionTree.png"></img>
    </div>
    <div class="infobox-data">
        <span class="infobox-data-number action-buttons">
            <a style="font-size: 18px;white-space: nowrap;width: 18em;overflow: hidden;text-overflow: ellipsis;" title="{{getChannelName(i)}}" href="#/channelList" ng-click="setLink(i)">{{getChannelName(i)}}</a>
        </span>
        <div class="infobox-content" style="font-size: 12px">
            <i class="fa fa-list-ol bigger-90 blue"></i> {{i.version}}
            <span style="font-weight: bold;">
                <i class="fa fa-clock-o bigger-130 blue"></i> {{i.binDataUpdateUserName}}
            </span> &nbsp;on {{i.binDataUpdatedOn}}
        </div>
    </div>
</div>
    </div>

{{i.version}
{{i.binDataUpdateUserName}
关于{i.binDataUpdatedOn}

从服务加载数据后,您可以在
中尝试
$scope.$apply()
函数

$scope.items = angular.fromJson(res.data);
$scope.$apply();

您是否记录并检查angular.fromJson(res.data)的打印内容还有回复res.data我看不到动态HTML中使用的项目。如果我错了请纠正我是@Crazy Mac res.data很好,它给了我正确的array@Rohankawade我将在需要保存数据的地方发布动态html的内容loaded@AMITHGUJJAR如果返回的对象是数组,是否迭代并显示数组中的对象?如果它只是一个数组,为什么要使用angular.fromJson()?
$scope.items = angular.fromJson(res.data);
$scope.$apply();