Bind AngularJS model into html comment for debugging purposes

I need to debug an object id. This kind of object appears many times on my interface and log usage will be difficult to track.

I want to be able to click on a specific object and with the inspector see a comment with it. Essentially, on my template, something like the following:

<!-- {{object.id}} -->

      

So this shows something like:

<!-- 182371923129837 -->

      

I try exactly this, but in the html comment I just get:

<!-- {{object.id}} -->

      

Instead of the number that I want to see. Tried searching first but didn't find anything similar to this problem. What am I missing?

+3


source to share


1 answer


You can't do it directly, angular won't compile html comments and even if you try to generate the comment text yourself like contcating {{"<!--"+ somedata +"-->"}}

it won't work, and if you try to trust it as html you can't mess with the comment why you need to check this answer



see this answer fooobar.com/questions/1573236 / ...

+1


source







All Articles