This is now broken.  Doesn't work with <div> / <span> as of 7/21/2014.

ng-bind-html is ignored.  ng-bind-html-unsafe is ignored.

Angular outputs escaped strings from the model.

$sce doesn't work.

in-place javascript functions don't work within the tags.  i.e. " 
{{decodeURIComponent(model.property)}} "


On Wednesday, April 4, 2012 1:01:24 PM UTC-5, Misko Hevery wrote:
>
> Sorry, not possible for several reasons:
>
>    -  there is no wrapping element to do innerHTML on
>    - The interpolate logic would have to special case the HTML
>    - The binding logic would have to special case HTML and do .innerHTML 
>    in some cases and .text in other. This would create complexity and slow 
>    down the rendering. 
>
> Why is this so hard?
>
>  <div> The markdown is {{markdown}}, and the final effect is <span 
> ng-bind-html="html"></span> </div>
>
>
> On Tue, Apr 3, 2012 at 7:16 PM, Freewind <[email protected]> wrote:
>
>> A filter `raw` would be great:
>>
>>  <div> The markdown is {{markdown}}, and the final effect is {{html *| 
>> raw* }} </div>
>>
>> Will it possible?
>>
>> On Wednesday, April 4, 2012 2:20:40 AM UTC+8, Peter Bacon Darwin wrote:
>>>
>>> So does the new version take the whole of the text element (i.e. "The 
>>> markdown is {{markdown}}, and the final effect is {{html}}") and convert it 
>>> into one template that is attached to the enclosing div?
>>>
>>> On 3 April 2012 17:57, Misko Hevery <[email protected]> wrote:
>>>
>>>> The old version of angular converted 
>>>> this:
>>>>  <div> The markdown is {{markdown}}, and the final effect is {{html}} 
>>>> </div>
>>>>
>>>> to:
>>>>  <div> The markdown is <span ng-bind="markdown"></span>, and the final 
>>>> effect is <span ng-bind-html="markdown"></span> </div>
>>>>
>>>> But the extra span would cause havoc with the way CSS would work. So 
>>>> the new angular dose not create any new spans, which is better. But it 
>>>> also 
>>>> means that there is no place to call innerHTML as there is no dom element. 
>>>> So you have to manually create the element.
>>>>  
>>>> On Tue, Apr 3, 2012 at 4:11 AM, <[email protected]> wrote:
>>>>
>>>>> Freewind, you could just do
>>>>>
>>>>> <div>The markdown is {{markdown}}, and the final effect is <span 
>>>>> ng-bind-html="html"></span></div>
>>>>>
>>>>>
>>>>> On Tuesday, April 3, 2012 6:24:49 AM UTC-4, Freewind wrote:
>>>>>>
>>>>>> I found it not convenient that we have to provide a html tag to use 
>>>>>> `ng-bind-html`.
>>>>>>
>>>>>> Consider this example:
>>>>>>
>>>>>>     <div> The markdown is {{markdown}}, and the final effect is 
>>>>>> {{html}} </div>
>>>>>>
>>>>>> I have non-escaping can work with `{{}}` syntax. Is it possible?
>>>>>>
>>>>>> On Monday, April 2, 2012 12:13:22 AM UTC+8, [email protected] wrote:
>>>>>>>
>>>>>>> Sorry, I meant:
>>>>>>> <div ng-repeat="p in paragraphs" ng-bind-html="p.content"></div>
>>>>>>>
>>>>>>> I need to start proofreading my posts, haha.
>>>>>>>
>>>>>>>  Andy
>>>>>>>
>>>>>>  -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "AngularJS" group.
>>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>>> msg/angular/-/W77h2Kt-ydEJ.
>>>>>
>>>>> To post to this group, send email to [email protected].
>>>>> To unsubscribe from this group, send email to angular+unsubscribe@
>>>>> googlegroups.com.
>>>>> For more options, visit this group at http://groups.google.com/
>>>>> group/angular?hl=en.
>>>>>
>>>>
>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "AngularJS" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to angular+unsubscribe@
>>>> googlegroups.com.
>>>> For more options, visit this group at http://groups.google.com/
>>>> group/angular?hl=en.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "AngularJS" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/angular/-/DAiuQaiCTycJ.
>>
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/angular?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to