Solved

AngularJS - Bind HTML  error $parse

Posted on 2015-01-22
1
276 Views
Last Modified: 2015-01-23
Hi..
I'm trying to bind HTML

   <span ng-bind-html={{fact.text}}></span>

I get an error

Error: [$parse:syntax] http://errors.angularjs.org/1.3.8/$parse/syntax?p0=%7B&p1=invalid%20key&p2=2&p3=%7B%7Bfact%7D%7D&p4=%7Bfact%7D%7D


The JSON looks like this.. any ideas?  thx


  "text": ["Quality",
                        "<b>12<b>",
                        "Report",
                        "<u>Basic</u>"],
0
Comment
Question by:JElster
1 Comment
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 40566032
With such skimpy information its hard to tell anything, though the error

"Invalid key fact"

suggests that "fact" is not in scope. See if thats indeed the case.

Also, post the controller (HTML + js) and ideally create a jsfiddle so that experts can actually see and solve it.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question