Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:18:13+00:00 2026-06-13T17:18:13+00:00

We use Angular mainly for our search form, which is pretty complex. We use

  • 0

We use Angular mainly for our search form, which is pretty complex. We use Solr as search framework and get our search results via AJAX/JSONP, which works perfectly.

There should be an image in every search result, but it can happen that there is none.
I use a filter to prevent nasty “X”s in the Internet Explorer when there is no img-URL in my search result.

angular.module('solr.filter', []).
    filter('searchResultImg', function() {      
        return function(input) {
            if (typeof(input) == "undefined") {
                return "http://test.com/logo.png";
            } else { 
                return input;
            }
        };
});

My linked image looks like this in the source code:

<a href="{{doc.url}}"><img src="{{doc.image_url | searchResultImg}}"/></a>

Like I said, the infos are delivered correctly, the “problem” I have is that Firebug sends a GET request with the Angular src like:

http://test.com/foldername/%7B%7Bdoc.image_url%20|%20searchResultImg%7D%7D

The link is edited, so it won’t work. Else customer freak out 😉

Does anyone have experience with this behaviour or knows a better way to set filters for src-tags?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:18:14+00:00Added an answer on June 13, 2026 at 5:18 pm

    Try replacing src with ng-src for more info see the documentation or this post.

    <a href="{{doc.url}}"><img ng-src="{{doc.image_url | searchResultImg}}"/></a>
    

    Using Angular markup like {{hash}} in a src attribute doesn’t work
    right: The browser will fetch from the URL with the literal text
    {{hash}} until Angular replaces the expression inside {{hash}}. The
    ngSrc directive solves this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Angular $resource for REST service. Due to the quirk in my get
I'd like to use socketstream's RPC over websockets abstraction while using Angular for MVC.
use the [] symbol in the name of the form field you are submitting
Use of java.net.URLConnection is asked about pretty often here, and the Oracle tutorial is
Use the static modifier to declare a static member, which belongs to the type
I have several TextBoxes, which display angular values. I format these using different custom
What is the use of using angular tag in css ie, .class << span
I want to use angular in an app except that angular is not loaded
I try to use angular.js with PhoneGap.It works fine at chrome browser.But it doesn't
I'm trying to use angular to load div's to supply to isotope for layouting.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.