2

パラメータを出力するdivだけですが、パラメータが表示されていない単純なコンポーネントを構築しようとしています:

test.html

<ion-content padding class="getting-started">
   <my-component [test]="Something"></my-component>
</ion-content>

test.ts

import {Page} from 'ionic-framework/ionic';
import {MyComponent} from './myComponent';

@Page({
    templateUrl: 'build/pages/test/test.html',
    directives: [MyComponent]
})

export class TestPage {
    constructor() {
    }
}

myComponent.ts

import {Component,Input} from 'angular2/core';

@Component({
  selector: 'my-component',
  template: `
    <div>Param: {{test}}</div>
   `,
})

export class MyComponent {
  @Input() test;
  constructor() {
  }
}

結果:

テキストが表示されない

何が欠けているのかわかりません。

4

2 に答える 2