I’m developing my first Ionic 2 custom component, included in a page in a tab, and mostly it’s working, but when I add an ion-item to the template, it crashes with the exception below.
The entire template is:
<ion-list><ion-item>xxx</ion-item></ion-list>
List is OK, Item is not. The following does NOT give the exception:
<ion-list>xxx</ion-list>
Does anyone have an idea how to include ion-item in my component?
Also, other things such as ion-icon don’t display and buttons are not styled.
The code for this component is what I’ve gathered from other posts:
import {Component, Input} from 'angular2/core';
import {IONIC_DIRECTIVES} from 'ionic-framework/ionic';
@Component({
selector: 'person-status',
templateUrl: 'build/components/person-status/person-status.html',
directives: [IONIC_DIRECTIVES];
})
export class PersonStatusComponent {
@Input() person;
constructor() {
}
}
The exception is:
[Error] EXCEPTION: TypeError: viewFactory_Item0 is not a function. (In 'viewFactory_Item0', 'viewFactory_Item0' is null)
[Error] STACKTRACE:
[Error] viewFactory_PersonStatusComponent0
viewFactory_RespondersScreen0
viewFactory_HostRespondersScreen0
createHostViewInContainer@http://localhost:8100/build/js/app.bundle.js:19905:48
createHostView@http://localhost:8100/build/js/app.bundle.js:19295:45
http://localhost:8100/build/js/app.bundle.js:48136:60
run@http://localhost:8100/build/js/app.bundle.js:1183:23
http://localhost:8100/build/js/app.bundle.js:17492:48
zoneBoundFn@http://localhost:8100/build/js/app.bundle.js:1156:23
lib$es6$promise$$internal$$tryCatch@http://localhost:8100/build/js/app.bundle.js:2556:25
lib$es6$promise$$internal$$invokeCallback@http://localhost:8100/build/js/app.bundle.js:2568:53
lib$es6$promise$$internal$$publish@http://localhost:8100/build/js/app.bundle.js:2539:53
http://localhost:8100/build/js/app.bundle.js:1288:8
microtask@http://localhost:8100/build/js/app.bundle.js:17532:32
run@http://localhost:8100/build/js/app.bundle.js:1183:23
http://localhost:8100/build/js/app.bundle.js:17492:48
zoneBoundFn@http://localhost:8100/build/js/app.bundle.js:1156:23
lib$es6$promise$asap$$flush@http://localhost:8100/build/js/app.bundle.js:2350:18