このエラーは数時間にわたって発生しています。私がアプリを実行すると、IOSシミュレータは白いページしか表示せず、何もロードされていないようです。私は何が間違っているのか分からなかった。私は分割バーでページを作ってみたい。ここに私の 'menu.component.ts' ファイルのコードは次のとおりです。NativeScript + Angular2 - SegmentedBarバインディング
import {Observable} from 'data/observable';
import {Component} from "@angular/core";
@Component({
selector: "menu",
templateUrl: "./components/menu/menu.html",
})
export class MenuComponent extends Observable {
public selectedItem: string;
public items: Array<any> = [
{ title: 'Home' },
{ title: 'G+' },
{ title: 'Sync' }
];
constructor() {
super();
this.selectedItem = `Selected: ${this.items[0].title}`;
}
public selectSegment(e: any) {
this.set('selectedItem', `Selected: ${this.items[e.newIndex].title}`);
}
}
と私の 'menu.html' ファイル:
<SegmentedBar items="{{items}}" selectedIndexChanged="{{selectSegment}}" ></SegmentedBar>
<Label text="{{selectedItem}}" ></Label>
は非常にありがとうnativescriptsnacks.comから作業例ですが、私はトンでまだです彼はレベルを学んで、私は何を混合していたか分からなかった:) – kenkulan