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 ...
If you want to keep the sub-folders, you have to define the base in the options (2nd argument)
e.g., to keep "assets/file.doc" in "dist/":gulp.src(["assets/file.doc"], {base: "."}) .pipe(gulp.dest("dist/"));
element = document.querySelector(selectors);
element — объект element.
selectors — строка, содержащая один или более CSS селекторов, разделённых запятой.
Интерфейс Element представляет собой один из объектов в Document. Этот интерфейс описывает методы и свойства, общие для всех видов элементов. Конкретные модели поведения описаны в интерфейсах, которые наследуют от Element, и добавляют дополнительную функциональность.
var currentLanguageID = document.getElementById(currentLanguage);
var langButton = angular.element(document.querySelector("#" + currentLanguage));
langButton.addClass("setLanguageButtonActive")