Questions tagged as 'angular'

1
answer

CMD does not recognize tsc -v (TYPESCRIPT) command

Very good. I'm trying to install Angular CLI. I installed node and npm, and I thought I had also installed typescript, but when I check if it has been installed through the command tsc -v I get the following message: "tsc" no se recono...
asked by 14.08.2018 / 21:37
1
answer

How can I replace the image?

.ts public change() { this.logo.nativeElement.src=data.image ; } I can not detect the "logo" or the date.imge html <img class="img-position" #logo src={{img}}> <img [src]="data.image" [width]="cropperSettings.cropped...
asked by 28.03.2018 / 13:02
2
answers

Receive Array / Create it in Angular2

I have to receive an Array in Angular2, since I have not yet done the "send it" thing, I'm simulating that I'm receiving it, the problem is that when using a ngFor it does not do anything. @Input() steps: Array<number>[4]; //Así no func...
asked by 23.04.2018 / 14:03
1
answer

Date format "dd-MM-yyyy" without pipe

I have this doubt, I need to record it in a variable with that format, but the pipe seems to work only in HTML. I need today's date with the format dd-MM-yyyy Today's date is like this this.today = Date.now(); But there I stay...
asked by 21.03.2018 / 18:04
2
answers

Access-Control-Allow-Headers in ServiceHTTP (POST) in agular 7

Someone could help me I have a problem. But I can not interpret it. user.service.ts postUser(user:User):Observable<User[]>{ let body = JSON.stringify(user); let headers = new HttpHeaders({ 'Content-Type': 'application/jso...
asked by 14.11.2018 / 21:07
1
answer

Load data when you have the variable loaded | Angular 7

I am consuming an API service in Node.JS and MongoDB this is the query. this._productService.getProductById(productId).subscribe( response => { this.product = response['product']; }, error => { console.log('Error'); } );...
asked by 03.01.2019 / 11:10
1
answer

Studying angle and ng new name_app does not work. What am I doing wrong?

It returns the following error: alberto@linuxdell:~/Escritorio/angular$ ng new --name=02spa --version=7.1.4 ? Would you like to add Angular routing? No ? Which stylesheet format would you like to use? CSS Error: **Schematic input does...
asked by 23.12.2018 / 13:34
1
answer

Embed [src]="src" does not work in Angular 7, unsafe url

I am trying to create a PDF viewer in Angular but when passing it the variable gives error. Can you give me a hand, please? HTML: <embed [src]="selectedFile" class="p-col-12" style="height: 800px;"> TS: private pathFiles = [...
asked by 07.12.2018 / 10:41
1
answer

Update the value of the formcontrol in keyup

I am trying to make the text capitalized when writing in the inputs, but this is not saved in the form control value. <mat-form-field> <input matInput formControlName="nombre" (keyup)="$event.target.value = $event.target.value.toU...
asked by 12.12.2018 / 17:41
1
answer

Simplify submit Form Angular 7

I have this function and I do not know if it can be simplified because I think it's too long. submitForm(){ if(this.operatoId){ this._oper.update(this.operatoId, this.registerForm.value).subscribe( (val) => { console....
asked by 04.12.2018 / 10:32