How do you include multiple dynamic classes in amp-bind?
For example:
<div [class]="condition1 ? 'classA' : 'classB'" [class]="condition2 ? 'classA' : 'classD'"></div>
You can return a single string containing multiple classes inside your amp-bind expression:
<div [class]="(condition1 ? 'classA' : 'classB') + ' ' + (condition2 ? 'classA' : 'classD')">...</div>
If you are referring to CSS classes, you can refer here.
The following CSS classes specifically amp-referrer-*
and amp-viewer
adds to the AMP Dynamic CSS Classes extension's <body>
element.
You can can out the sample project provided here to have a view on how it is implemented.