dhiman252
3 years ago
107
8
General

Blade and angular mixing

Posted 3 years ago by dhiman252

In Laravel we can escape {{}} by prefixing the first curly brace with an @ symbol. @{{ $variable }} will return {{ $variable }} and AngularJS can deal with that.

Now, I have an image tag in the blade like the following:

<div ng-repeat="ratingImage in user.ratingImages track by $index"><img src="@{{ ratingImage }}"/></div>

and when I run this I get the following errors in my firebug console:

`"NetworkError: 404 Not Found - http://xwz.me/home/%7B%7B%20user.image%7D%7D" {{ user.image}} 

"NetworkError: 404 Not Found - http://xwz.me/home/%7B%7B%20ratingImage%20%7D%7D"`

How to resolve this ?

Please sign in or create an account to participate in this conversation.