Question: I am new to Angular and I have two collapse div elements and when I click on button1 then div element-1 need to collapse and element-2 need to be hide.

And when I click button2 then div element-2 need to collapse and element-1 need to be hide, but it's not working using below code.

```
<div class="container">
  <h2>Simple Collapsible</h2>
  <button type="button" class="btn btn-info" (click)="selectItem='one'" data-toggle="collapse" data-target="#demo1">Simple
    collapsible</button>
  <button type="button" class="btn btn-info" (click)="selectItem='two'" data-toggle="collapse" data-target="#demo2">Simple
    collapsible</button>

  <div [ngClass]="(selectItem=='one')?'visiable':'hide'">
    <div id="demo1" class="collapse">
      <h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
        sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</h2>
    </div>
  </div>

  <div [ngClass]="(selectItem=='two')?'visiable':'hide'">
    <div id="demo2" class="collapse">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit,
      sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
      quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </div>
  </div>
</div>

```

<https://stackblitz.com/edit/angular5-bootstrap4-crud-device-list-simple-zxunj1?file=app%2Fapp.component.html>

Answer: 
Try using single quote marks inside the ternary

```
<div
   class='@(Model.HeroBannerImageSmall ? "--imageSmall" : "--image")'
   style='@(Model.isSelected ? "background-position-x:@Model.CropPositionX" % "background-position-y:@Model.CropPositionY"&; : "background-position:@Model.UniformCropPosition"&;')
   background-image: url(@Model.ContentUrl)'>
</div>

```
You've gotta mix and match your single and double quotes to make this work! For example:

```
class='@(Model.HeroBannerImageSmall ? "--imageSmall" : "--image")'

```

Potentially might be easier to read if you pulled it out into a code branch ahead of the div. ie:

```
@{
    var imageClass = Model.HeroBannerImageSmall ? "--imageSmall" : "--image";

    var imgageStyle = Model.isSelected ? 
              "background-position-x: " + Model.CropPositionX + "% background-position-y: " + Model.CropPositionY + "%;" : 
              "background-position: " + Model.UniformCropPosition + "%; ";
     imgageStyle += "background-image: url(" + Model.ContentUrl + ")";

}

class='@imageClass' style='@imageStyle'

```