2

I have written the following code:

<div class="item item-input video-preview-container" ng-if="thumbnail.length > 0">
                <video poster="{{thumbnail}}" ng-src="{{clipSrc}}" class="centerme margin-vert-2x" controls="controls" preload="metadata" webkit-playsinline="webkit-playsinline"></video>
                <i class="ion ion-android-cancel fs30 margin-left-2x" ng-click="removeVideo()"></i>
            </div>

now on running this i am getting error:

GET http://localhost:8100/%7B%7Bthumbnail%7D%7D 404 (Not Found)

however it is noticeable that the error is coming when my div isn't yet loaded as my ng-if condition is still less than 0

UPDATE: the problem is with poster="{{thumbnail}}" code as when i remove this the error is not coming.

11
  • remove the "==true" part and try with just ng-if="thumbnail.length" Commented Jan 6, 2017 at 14:14
  • actually it was mistypes the actual condition is ng-if="thumbnail.length>0" Commented Jan 6, 2017 at 14:16
  • Could you please add more code, maybe a controller? Commented Jan 6, 2017 at 14:17
  • Where do you insert the URL? I can't find this in your example. Commented Jan 6, 2017 at 14:20
  • Instead of ng-if use ng-show. That way your div will reside in the DOM. Also can you confirm if the image URL (localhost:8100/%7B%7Bthumbnail%7D%7D) is correct. Commented Jan 6, 2017 at 14:21

1 Answer 1

6

Have you tried using ng-attr-poster ? Most of time these problems are due to data binding not happening

Sign up to request clarification or add additional context in comments.

1 Comment

yeah maybe I have to interpolate my poster attribute

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.