Shree108 Shree108 - 4 months ago 24x
AngularJS Question

NetworkError: 404 Not Found in angularjs with ng-if

I am getting this error notification

"NetworkError: 404 Not Found -"

I am using this code in view.

<img ng-if="user.image" src="assets/images/{{ user.image }}">

Although I have all images stored in server.

Please help me to understand that, why I am getting this error ? thanks.


Angular offers you ng-src - this way, the source url will be placed in src only after the interpolation has been made. This way you won't end up with the browser trying to get this url -"

Can you spot the user.image in the url? this indicates that the src has not been interpolated yet.