如何在角度4中使用选择器选择器

时间:2017-05-08 18:25:35

标签: angular angular2-template

enter image description here> home.component.ts

@Component({
    selector: 'jhi-home',
    templateUrl: './home.component.html',
    styleUrls: [
        'home.scss'
    ] 
})
  

// home.component.html

<jhi-download></jhi-download>
<jhi-contact></jhi-contact>
.....
<h3 jhiTranslate="global.title">TEST</h3>  [working]  jhiTranslate: true
  

// contact.component.ts

@Component({
    selector: 'jhi-contact',
    templateUrl: './contact.component.html'
})
  

// contact.component.html

<h3 jhiTranslate="global.title">TEST</h3>  [not working] jhiTranslate: false

虽然它在home组件中有效,但是当我从内部调用它时它不起作用。例如,

中没有翻译
 <jhi-download></jhi-download>
  <jhi-contact></jhi-contact>

您如何建议解决方案?

0 个答案:

没有答案