typescript 角度 - 指令选择器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 角度 - 指令选择器相关的知识,希望对你有一定的参考价值。

// Directive Selectors
@Directive({
  selector: '[hsPaywall]'
})
@Directive({
  selector: 'a' // applied to all anchor tags
})
@Directive({
  selector: '.class' // applied to all elements with that class
})
@Directive({
  selector: '[hsPaywall]'
})
@Directive({
  selector: '.class:not(".class2")' // apply to all elements with a class other than
})
@Directive({
  selector: '.class, .class2' // multiple classes
})
@Directive({
  selector: 'input[type="password"]' // filter the elements via attribute
})
@Directive({
  selector: '.class, [hsPaywall]' // multiple different selector types
})

以上是关于typescript 角度 - 指令选择器的主要内容,如果未能解决你的问题,请参考以下文章