2017-06-16 58 views
2

我可以這樣做:我如何可以加載AngularJS控制器值HTML Thymeleaf標籤

<source th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"></source> 

像這樣:在日

<source scr="{{videoPaths[$index]}}" type="video/mp4"</source> 

要不我怎麼能負載值從控制器:SRC? 你能否以另一種方式提供給我?

更新

<li ng-repeat="video in videos">Video-ul: {{$index+1}} > 
      <video 
       width="300" controls="controls"> 
       <source ng-src="{{videoPaths[$index]}}" 
        th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"> 
       </source> 
      </video> 
    </li> 

更新:

顯然Thymeleaf它成功地加載視頻,如果我這樣離開源:

<source th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"></source> 

 <source src="{{videoPaths[$index]}}" th:src="@{{{videoPathsTh[$index]}}}" 
    type="video/mp4"></source> 

但我收到此錯誤:

Failed to load resource: the server responded with a status of 404() - /%7B%7BvideoPathsTh[$index]%7D%7D

我想這是因爲服務器加載HTML文件的客戶端加載頁面和AngularJS controller不能發送值

+0

你可以請添加控制器代碼,所以我會幫你 – Mitul

+0

Videopaths它只是一串字符串 – Rares

+0

我更新了我的帖子,通過添加我需要這些值 – Rares

回答

1

我想這是不可能的前.. 。謝謝