1
에 입력 설정 타입 I 다음 지시문이 있습니다Angular2 : 지시어
@Directive({
selector: "[myDir]"
})
export class MyDir implements OnInit {
private el:HTMLElement
@Input() hide: boolean
constructor(el: ElementRef) {
this.el = el.nativeElement
}
ngInit() {
console.log(typeof this.hide) // Writes string in the console
}
}
템플릿 :
<p myDirnumber=1 hide=false></p>
내가 부울 형식을 취할 숨기기를 강제 수 어쨌든 있나요?
감사합니다. 나는 그 사실을 잊어 버렸다. – Scipion