0

I tried to add bootstrap grid classes to the movie-mage-card template like that and used movie-image-card component in movie-image-grid component.

movie-image-card.component.html

<div id="movie-image-card" class="col-12 col-sm-6 col-md-4">
</div>

movie-image-grid

   <div class="container">
        <div class="row">
            <movie-image-card></movie-image-card>
        </div>
    </div>

However, this bootstrap grid classes does not work properly since movie-image-card itself does not have col-* class. Instead, I see extra wrapper.

enter image description here

The classes work if I add classes like below. However, I do not want to add classes every time I use movie-image-card.

How to achieve this ??

<div class="container">
    <div class="row">
        <movie-image-card class="col-12 col-sm-6 col-md-4"></movie-image-card>
    </div>
</div>

1 Answer 1

2

Add

host: {'class': 'col-12 col-sm-6 col-md-4'}

to your component decorator.

Demo: http://plnkr.co/edit/yo8fiskwBwX83uLgKWca?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.