3

I have the following row in my jade file

img(src="{{ item.product.image1.match('http') ? item.product.image1 : 'http://s3-eu-west-1.amazonaws.com/#{_awsbucket}item.product.image1 }}'", alt='{{item.product.productNumber}}')

As you can see, I want to add http://s3-eu-west-1.amazonaws.com/{bucket} as src when the URL does not contain 'http'. This condition fails, (angular error), but I can't see any errors. Maybe someone have an idea?

angular.js:12477Error: [$parse:lexerr] http://errors.angularjs.org/1.4.7/$parse/lexerr?p0=Unterminated%20quote&p1=…ttp%3A%2F%2Fs3-eu-west-1.amazonaws.com%2F***bucket***item.product.image1

1 Answer 1

3

I guess the problem is here:

'http://s3-eu-west-1.amazonaws.com/#{_awsbucket}item.product.image1 }}'"

you have placed a quote in the wrong place. replace it with:

'http://s3-eu-west-1.amazonaws.com/#{_awsbucket}item.product.image1'}}"
Sign up to request clarification or add additional context in comments.

3 Comments

Ahhh. You found it! Thanks! Changed the quote little bit, show it will show the image instead of the plain text 'item.product.image1' s3-eu-west-1.amazonaws.com/#{_awsbucket}'+ item.product.image1}}"
So you resolved your issue? if you need no further assistance, close the question by accepting the answer (so we don't pollute unresolved questions on SO).
Hi, yeah accepted now. A little minute ago, I was to fast to accepted the answer :)

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.