Create Component Inline

    0

    2

    Jose Romero

    Angular TypeScript Recipes

    This code defines a named selector that can be used in a template. The selector is defined as a class and the OnInit method is registered as an ngOnInit method.

    Library: angular

    Shortcut: angular.component.inline

    import { Component, OnInit } from '@angular/core';
    
    @Component({
      selector: 'selector-name',
      template: ``
    })
    export class NameComponent implements OnInit {
      constructor() { }
      ngOnInit() { }
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • 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.