How to perform a parameter type href on an image using Ionic / Angular Js

4

I have this code snippet, which shows an image with a CSS above:

 <img class="imagemCapa" image-lazy-loader="lines" ng-src="{{item.cadastra_oferta_foto}}" />
                    <div class="promocao"><b>{{item.cadastra_oferta_desconto}}% Off</b></div>
                    <div class="desconto"><b>{{item.cadastra_oferta_valor_com_desconto | currency}}</b></div>

I would like to reference this image to another $ state, as I use a button:

 <a class="item button button-clear button-assertive ink" href="#nhaac/ofertas_singles/{{item.cadastra_oferta_cod_oferta}}">MAIS INFORMAÇÕES</a>

If I put it in the img class, crop the image. I tried ui-sref but it does not work.

How can I pass this url with parameters in the image and not crop the image?

Taking advantage of the image CSS:

/* Coloca o desconto na imagem */
.imagemCapa{
    width: 100%;
    height: auto;

}
.promocao{
    position: absolute;
    top: 3%;
    left: 4%;

    z-index: 300;
    float: left;
    background: #D95B43;
    padding: 10px;
    border-radius: 100px;
    color: #FFF;

}

.sacola{
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 300;
    float: left;
    font-size: 40px;
    padding: 10px;
    border-radius: 100px;
    color: #E81D62;

}

EDITED:

This excerpt from the code shows me an image like this:

Inadditiontothebuttontogointothedetailsofthisproduct,Iwouldliketheimagetoalsobedirectedtotheproductdetails.InthebuttonIuse:

<aclass="item button button-clear button-assertive ink" href="#nhaac/ofertas_singles/{{item.cadastra_oferta_cod_oferta}}">MAIS INFORMAÇÕES</a>

But this approach in the image does not work, it cuts the image not showing it all.

    
asked by anonymous 09.08.2017 / 19:24

1 answer

3

You can dynamically mount (Coming from some controller):

ui-sref="{{vm.suaVariavel}}({parametro:'valor'})">

Or statically (Direct state name in the view)

ui-sref="nomeDoEstado({param1: 'valor', param2: 'valor'})" ui-sref-opts="{reload:true}"

I placed the option reload true if it is necessary to reload the page.

    
16.08.2017 / 18:28