ここでは、単純な角度のアプリケーションを作成しようとしています。私はappコンポーネントよりもtutorialcomponentという名前のコンポーネントをもう1つ作成しました。今、tutorialComponentのセレクタを使用して、私はそれをアプリケーションコンポーネントに埋め込もうとしています。しかし、私は埋め込んだ後、アプリケーションコンポーネントの出力を取得していません。 別のコンポーネントを角度2のアプリケーションに追加する
がそう私にコンポーネントをバインドする方法を提案してください、import { Component } from '@angular/core';
import {TutorialComponent} from './tutorial/tutorial.component';
@Component({
selector: 'app-root',
template: `./app.component.html
<app-tutorial></app-tutorial>`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'My Angular2 Login App';
}
ここtutorialcomponentあり、ここで
import { Component } from '@angular/core';
@Component({
selector: 'app-tutorial',
templateUrl: './tutorial.component.html',
styleUrls: ['./tutorial.component.css']
})
export class TutorialComponent {
}
私の出力は次のとおりです。 はここに私のアプリのコンポーネントです。
試しをセレクタは 'app-tutorial'で、テンプレートではなくtemplateUrlがhtmlコンテンツを識別します。 –