farcasmihai91
4/21/2018 - 7:56 AM

Angular - Directive Selectors

// 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
})