我如何在Clarity中单击按钮?

时间:2018-06-26 14:13:03

标签: angular typescript clarity

我有12个按钮,每个按钮都有任何数据,我需要知道该按钮已经单击了用户。

小部分:

<clr-tab>
        <button clrTabLink id="january" >january</button>
        <clr-tab-content id="january" *clrIfActive> 
  <option *ngFor=
 <clr-tab>
        <button clrTabLink id="february" 
         [disabled]="enableMonth(2)">february</button>
        <clr-tab-content *clrIfActive>
          <option *ngFor=
        </clr-tab-content>

我清楚地使用了Angular5,可以以“ January”,“ Febrary”等形式获取数据,但是无法获得“ Tabs”或按钮选择。

我尝试过:

component.ts

  public january;
  public february;

 save(){
    console.log('january' , this.january);
    console.log('february' , this.february);
  }

每个月:

  <clr-tab-content id="january" [(clrIfActive)]="january">

我的想法是检查“ january”!=未定义,然后知道月份选择... 但是我有错误:

Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[NgIf -> TemplateRef]: 
  StaticInjectorError(Platform: core)[NgIf -> TemplateRef]: 
    NullInjectorError: No provider for TemplateRef!
Error: StaticInjectorError(AppModule)[NgIf -> TemplateRef]: 
  StaticInjectorError(Platform: core)[NgIf -> TemplateRef]: 
    NullInjectorError: No provider for TemplateRef!

0 个答案:

没有答案