I use Ionic 3. *, tring to create a component containing only a button.
Component Code:
@Component({ selector: 'profile-button', templateUrl: 'profile-button.html', }) export class ProfileButtonComponent { constructor( private popoverCtrl: PopoverController ) {} async presentPopover(ev) { let popover = this.popoverCtrl.create(ProfilePopover); return popover.present({ ev }); } }
and my template:
<button ion-button icon-only (click)="presentPopover($event)" title="Profile"> <ion-icon name="person"></ion-icon> </button>
Problem:
The problem is that the icon-only directive is simply ignored. The button still has a background color. If I lay out the template outside the component, it will display the correct style.
Directives appear to be unavailable within a Component. My component is inside a custom module, not on an AppModule.
How can i solve this? Found that on Ionic2 I need to import the directives manually, but it does not work on Ionic3.
source share