Ng-bind-html and data-toggle="modal" do not work

0

My project consists of creating sun elements from js, for this I use angular and its function ng-bind-html, the ng-bind-html serves me in all cases except this one.

I want to add the following tag when adding a text.

<a data-toggle="modal" href="#modalAcquisitionMode">VER FIGURA MODALIDAD DE ADQUISICIÓN</a>

The problem is that when you add the tag the property data-toggle="modal" is deleted and without it the tag does not work.

Does anyone know how I can solve this?

PS:

When the screen appears on the screen, it appears like this

 <a href="#modalAcquisitionMode">VER FIGURA MODALIDAD DE ADQUISICIÓN</a>
    
asked by Alejo Florez 09.07.2018 в 17:32
source

1 answer

0

The problem comes in the attributes that have ng-bind-html approved for ahref in your library, what you have to do is simple.

must look for the variable where they define the attributes of the tag in angular-sanitize (in my case the variable is called uriAttrs )

var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href,data-toggle');

There you add the new properties that the library will recognize, in this case data-toggle , but you can add any new attribute.

    
answered by 09.07.2018 / 17:49
source