0

I'm trying to use a _.select method to return an array of people that match a certain category. I will then use this later in my script to add them to my span tag. But right now I get an error when I try to run this code. error: illegal character

One other note data is an object I'm passing into the template.

  <script id="product" type="text/template">        
    <p><span>Director</span><span class='director'>
       <% var people= _.select( data.artists, function( item ){
        return item.name == 'painter';
   })%>
  </span>
 </script>

1 Answer 1

1

You need to add the semicolon at the end of the template tag.

  <script id="product" type="text/template">        
    <p><span>Director</span><span class='director'>
       <% var people= _.select( data.artists, function( item ){
        return item.name == 'painter';
   }); %>
  </span>
 </script>
Sign up to request clarification or add additional context in comments.

Comments

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.