Angular Directive



    Jose Romero

    Angular TypeScript Recipes

    In this example, the @Directive annotation is used to declare a class named NameDirective. The constructor of this class will be automatically invoked when the selector is invoked.

    Library: angular

    Shortcut: angular.directive

    import { Directive } from '@angular/core';
    @Directive({ selector: '[selector-name]' })
    export class NameDirective {
      constructor() { }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.