流星2と角度2のチュートリアルに続き、ステップ11に達したときPhoneGapでAndroidまたはiOSでアプリを実行するできません私のアンドロイドデバイスで作業します。アプリAndroidのページを読み込んでいるときにangular2で固定されたangular2のソーシャルチュートリアル
これはコンソールから出力されます。
Error: Uncaught (in promise): Error: Error in ./AppComponent class AppComponent_Host - inline template:0:0 caused by: The selector "app" did not match any elements
これは私がこれまでのところ、私のapp.component.tsファイルにしたものである:
import { Component } from '@angular/core';
import template from './app.component.html';
@Component({
selector: 'app',
template
})
export class AppComponent {}
アプリは、Webブラウザ上で完璧に動作します。私はそれがルータの問題かもしれないと思うが、私は確信していない。
これはapp.routes.tsからコード
import { Route } from '@angular/router';
import { Meteor } from 'meteor/meteor';
import { PartiesListComponent } from '../parties/parties-list.component';
import { PartyDetailsComponent } from '../parties/party-details.component';
export const routes: Route[] = [
{ path: '', component: PartiesListComponent },
{ path: 'party/:partyId', component: PartyDetailsComponent}
];
これはindex.htmlにあるある:
<head>
<base href="/" />
</head>
<body>
<app>Loading...</app>
</body>
そして、これはapp.component.html
<div>
<router-outlet></router-outlet>
</div>
です
PartiesListComponentにリダイレクトされますが、そのエラーをスローして読み込みに固執します。ありがとうございました。