Shree108 Shree108 - 1 year ago 101
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download