# Swap - ngClass

### Code

```javascript
<button class={"prev " + (this.start === 0? 'disabled' : '')}></button>
```

### Context

Think of this as a button, that is part of a pagination component. \
If, the user is at the start of the list, then the Previous button i.e. ( button with the class '.prev' ) should be disabled.&#x20;

With Angular, we would generally use [ngClass](https://codecraft.tv/courses/angular/built-in-directives/ngstyle-and-ngclass/).

The alternative with StencilJS is to use a _Data binding expression,_ based on the value of the 'start' variabl&#x65;_._ This then allows you to add as many classes as need be.&#x20;

### Reference

{% embed url="https://stackoverflow.com/questions/48005289/how-to-handle-ngclass-in-stencils-js-web-components" %}



