Sollicitatievraag bij Cognizant

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

Antwoorden op sollicitatievragen

Anoniem

18 jun 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

Anoniem

21 feb 2020

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