Hi, I made a custom component and using the ionic ui components inside it. It renders but the styles are gone. Here’s my accordion custom component.
accordion.ts
import { Component, Input } from '@angular/core';
@Component({
selector: 'accordion',
templateUrl: 'accordion.html'
})
export class AccordionComponent {
@Input('title') title: string;
text: string;
constructor() {
}
}
accordion.html
<ion-item>
{{ title }}
</ion-item>
<ion-item text-wrap>
<ng-content></ng-content>
</ion-item>
and in my page, I’m using it like this.
<ion-list>
<ng-template ngFor [ngForOf]="getBooks()" let-book>
<cif-accordion
[title]="book.name">
<button ion-button clear *ngFor="let c of book.chapters">
{{ c }}
</button>
</cif-accordion>
</ng-template>
</ion-list>
components.module.ts
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AccordionComponent } from './accordion/accordion';
@NgModule({
declarations: [AccordionComponent],
imports: [],
exports: [AccordionComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentsModule {}
and this components module is added to the app.module.ts
.
but seems the ion-item
styles are not applied at all. any tips?