Html AngularJs,是否可以插入从$scope数组获取的数据?

Html AngularJs,是否可以插入从$scope数组获取的数据?,html,angularjs,Html,Angularjs,我有以下javascript代码: app.controller('Ctrl',[ '$scope', function ($scope){ $scope.poems =[ {title:"title1", author:"author1", file:"URLfile1"}, {title:"title2", author:"author2", file:"URLfile2"},

我有以下javascript代码:

app.controller('Ctrl',[ '$scope', function ($scope){
    $scope.poems =[
                    {title:"title1", author:"author1", file:"URLfile1"},
                    {title:"title2", author:"author2", file:"URLfile2"},
                    {title:"title3", author:"author3", file:"URLfile3"}
                    ];
}]);
在html中,我想做如下操作:

<div ng-repeat ="poem in poems">
   <h1>{{poem.title}}</h1>
   <p>{{poem.author}}</p>
   <div ng-include="{{poem.file}}"></div>
</div>

{{诗名}
{{诗.作者}}

但这似乎不起作用。
你有什么建议吗?

那么你可以试试这个

<div ng-include src="{{poem.file}}"></div>

这可能行得通。

解决方案是

<div ng-include src="poem.file"></div>


没有括号

什么是URLfile1?它是html文件吗?如果是,它是否与您发布的html文件位于同一路径?是的,它是一个html文件。在同一路径中,检查inspect元素中的
{{poem.file}}
得到的值是多少。Nothing。我没有任何价值。空白您应该通过放置console.log检查您的
$scope.poems
,检查它是否具有文件属性的任何值。控制台中的错误太长,但它表示这是一个解析问题。错误:[$parse:syntax]我自己找到的。是的。无括号