Open a modal automatically with angle in ng-repat

0

I have the following repetition:

<div ng-repeat="post in posts" class="modal fade modal-custom " id="myModal[[post.id_post]]" tabindex="-1" role="dialog" aria-labelledby="myModalLabel[[post.id_post]]" aria-hidden="true">
...
</div>

If post.open is equal to 1, I want the popup to open automatically, some tip?

thanks in advance.

    
asked by Sebastian Montenegro 30.11.2017 в 22:38
source

1 answer

0

There can be multiple forms, for example, you can use a ternary operator within {{}} keys and if true you call the function that opens your modal.

<div ng-repeat="post in posts" class="modal fade modal-custom " id="myModal[[post.id_post]]" tabindex="-1" role="dialog" aria-labelledby="myModalLabel[[post.id_post]]" aria-hidden="true">
  {{post.open?miFuncion(aquí_puedo_pasar_valores):'No pasa nada'}}
</div>
    
answered by 07.12.2017 в 20:54