Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

ng-style with background image #418

Open
Valonix opened this issue Oct 4, 2016 · 2 comments
Open

ng-style with background image #418

Valonix opened this issue Oct 4, 2016 · 2 comments

Comments

@Valonix
Copy link

Valonix commented Oct 4, 2016

Hi there.
Can i use something like this?

<ul class="slider__list" rn-carousel rn-carousel-index="$ctrl.carouselIndex" rn-carousel-controls rn-carousel-controls-allow-loop > <li ng-repeat="slide in $ctrl.slides track by slide.id" class="slide" ng-style="{'background-image': 'url(/images/slides/' + slide.image + ')'}"> <div class="slide-wrap"> <img class="img-responsive" ng-src="/images/logos/{{$ctrl.logo}}.svg" alt=""> <p>{{slide.body}}</p> </div> </li> </ul>

Because right now i didn`t see backgound image..

@Valonix
Copy link
Author

Valonix commented Oct 7, 2016

so? any ideas?

@auxcoder
Copy link

auxcoder commented Jan 22, 2017

Yes you can but ng-style accept an expression, should be like this ng-style="{'background-image': 'url(/images/slides/{{slide.image}})'}".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants