Category : typescript

I have created a custom file upload angular component and I am using it in a template driven form. The form contains angular material components. I want this custom component to be required with the template driven form. This is the html code for the custom component: <input type="file" class="file-input" (change)="onFileSelected($event.target.files[0])" #fileUpload> <div class="file-upload"> <button ..

Read more

I want to make parent components communicate to child components by injecting directly the providers in the ts file of each child component for that I want to get a data using the get & set but I do not understand how to do ? service export class ProductSharingDataService { public productName!:any; constructor() { } ..

Read more

i’m getting error at line 15 It showing that not all code paths return value How to fix below code Error: src/app/authguard.guard.ts:15:1 – error TS7030: Not all code paths return a value. Here is my code import { Injectable } from ‘@angular/core’; import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree,CanActivate, Router } from ‘@angular/router’; import { ApiService } ..

Read more

I have one component that can either recieve [patient] or [patientId] as @Input parameter selectedPatient has a value when it comes from a search result viewOrdersClientId has a value when it comes from another page Currently I’m showing one or the other in this way (as a workaround) <div *ngIf="selectedPatient |¬†async as patient"> <wss-patient-detail-component [patient]="patient"> ..

Read more

I’m making a movie site and when I click on the image to redirect to the movie page, I’ve already managed to do this, but to work I’m having to put several :id/:id/:id in app.routing. If I just put a :id it appears that it is changing the route but it doesn’t load other movies. ..

Read more