Question d’entretien chez Cognizant

Q. How can you create a component manually i.e. without using angular CLI.?

Réponses aux questions d'entretien

Utilisateur anonyme

18 juin 2021

You have to create the files manually and import the component in the app module. Eg: you want to create Cart component. 1. create a folder cart 2. inside this folder create three files - cart.component.html , cart.component.css, cart.component.ts 3. In cart.component.ts - add the below lines import { Component } from '@angular/core'; @Component({ selector: 'app-cart', templateUrl: './cart.component.html', styleUrls: './cart.component.css' }) export class CartComponent { constructor(){} } 4. In app.module.ts file add import- import { CartComponent } from './Cart/cart.component'; add declaration - CartComponent

1

Utilisateur anonyme

21 févr. 2020

Q. How can you create a component skipping the spec.ts file?