문제

I have a list of files of different formats. What I want to achieve is a gallery with preview functionality. Everything works great if you click through items of the same format (e.g jpg) but when I click on a SWF file it creates correctly the <object> element and I get the preview but, if after previewing an SWF I click on a JPEG file, it shows me previews for both elements, <object> and <img>.

How can I Show/Hide <object> elements?

Below is the code that I'm using:

<ng-object ng-if="file.format == 'swf'"
    width="{{file.width}}"
    height="{{file.height}}"
    ng-data="{{file.url}}">
</ng-object>

<img ng-if="file.format != 'swf'" ng-src="{{file.url}}" />
도움이 되었습니까?

해결책

@Yauheni Leichanok Thanks for your comment. It worked great for me.

ng-show was the correct answer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top