2017-11-25 11 views
0

ng-template 태그의 스타일링에 어려움을 겪고 있습니다.
나는 지금까지 내 .css 파일에 시도 것을 내 .css 파일 클래스를 추가 각도 ng-template 선택기를 지정하는 방법

  • 에서 ID로 #other_content 사용

    • 스타일링의 모든 <td> 태그
  • <ng-template>

    작동하지 않습니다. 검색 후 아무 해결책도 찾지 못했습니다.

    HTML은 : 이미지

    <div class="cont"> 
        <div class="scolldiv"> 
         <table border="1"> 
          <thead> 
           <tr> 
            <th>Char</th> 
            <th>Break After</th> 
            <th>Remove</th> 
           </tr> 
          </thead> 
          <tbody> 
           <tr *ngFor="let charobj of Chars;let i = index" [attr.data-index]="i"> 
            <td>{{charobj.char}}</td> 
            <td class="tdcell" *ngIf= "charobj.after; else other_content">YES</td> 
            <ng-template #other_content>NO</ng-template> 
            <td> 
             <MyBtn 
              [ID]="'btnaddchars_' + i" 
              [BackColor]= "globals.sysButtonBackColor" 
              [Color]= "globals.sysButtonForeColor" 
              [HoverBackColor] = "globals.sysHoverButtonBackColor" 
              [HoverColor] = "globals.sysHoverButtonForeColor" 
              [Text] ="'Delete'" 
              [SecondText]="'Close'" 
              [Width] ="'70px'" 
              [Height]="'17px'" 
              (buttonWasClicked) ="onSymbolsFormButtonClick($event)" 
              > 
             </MyBtn> 
            </td> 
           </tr> 
    
          </tbody> 
         </table> 
        </div> 
    </div> 
    

    :

    enter image description here

  • 답변

    0

    당신은 ngIf와 전체 태그 이후 NO를 주위

    <td class=..> </td> 
    

    을 넣어 가지고는을 통해 교체입니다 else 경우 템플릿.

    +0

    감사합니다. 완벽하게 작동합니다. – jonathana