There are three kinds of directives in Angular:
Components—directives with a template.
Structural directives—change the DOM layout by adding and removing DOM elements.
Attribute directives—change the appearance or behavior of an element, component, or another directive.
Advantages of Components:
simpler configuration than plain directives
promote sane defaults and best practices
optimized for component-based architecture
writing component directives will make it easier to upgrade to Angular
When not to use Components:
for directives that need to perform actions in compile and pre-link functions, because they aren't available
when you need advanced directive definition options like priority, terminal, multi-element
when you want a directive that is triggered by an attribute or CSS class, rather than an element
*ngIf="authTokenService.currentUserData"
[src]="authTokenService.currentUserData ? authTokenService.cu ...
var currentLanguageID = document.getElementById(currentLanguage);
var langButton = angular.element(document.querySelector("#" + currentLanguage));
langButton.addClass("setLanguageButtonActive")
$(document).ready
$('#prev_search').click
@Component({selector: 'greet', template: 'Hello {{name}}!'})
class Greet {
name: string = 'World';
}