Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Activate sub-pages from a main page

$
0
0

Does [ngClass] work in ionic 2?

I tried many variations on your example but it just ignores the [ngClass], always defaulting the button color to blue. I ended up doing a simple

<ion-content>
<button full [ngClass]="{danger: true, primary: false, secondary: false}">TEST</button>
</ion-content>

It does not throw any errors either, just acts as if the [ngClass] wasn't there.

I also added

import {ngClass} from 'angular2/common';

at the top, just in case, although I believe the directive is built-in anyway...

The second option you mentioned using [ngStyle] works fine.

ps: can't seem to get code indentation in the preformatted text in this forum ..


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>