What Are decorators? The Decorators are functions that modify JavaScript classes and it also used for attaching metadata to classes. Directive decorator and metadata Properties - @ Directive ({ selector? : string inputs ?: string [] outputs ?: string [] host ?: {...} providers ?: Provider [] exportAs ?: string queries ?: {...} }) Selector – It is a CSS selector that tells Angular to create an instance of this component wherever it finds the corresponding tag in template HTML. For example, it is – < app-login ></ app-login > CSS selector also triggers the instantiation of a directive. The selector may be declared by element name, class name, attribute name, and attribute name & value. Suppose we have a directive with an <input type="checkbox"> selector and the HTML looks like this. < fo...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers