Posts

Showing posts with the label angular

Can you generate sine wave data continuously from an Angular service and inject it into a component?

Image
Clash Royale CLAN TAG #URR8PPP Can you generate sine wave data continuously from an Angular service and inject it into a component? I have a component which has an injected service to retrieve static mock data. I would like to add the ability to generate data at a variable frequency and send the new (appended, time series) data to the component as it is generated. I can't for the life of me figure out how to accomplish this. All I know for sure is that the data object for the component must be immutable. plotter.component.ts: import { Component, OnInit } from '@angular/core'; import { MockDataService } from '../../services/mock-data/mock-data.service'; @Component({ selector: 'app-plotter', templateUrl: './plotter.component.html', styleUrls: ['./plotter.component.css'] }) export class PlotterComponent implements OnInit { single: any; multi: any; // rt needs to be an immutable object array // rt needs to be updated with data from ...

Calling angular 4 router with Multiple parameters from C#

Image
Clash Royale CLAN TAG #URR8PPP Calling angular 4 router with Multiple parameters from C# I want to call router with multiple parameters using C#.Here is i am making url var _email = UtilityConverter.Encrypt(Email); var _userId = UtilityConverter.Encrypt(Convert.ToString(UserId)); // this.router.navigate(['search', { term: term}]); var _subject = "Email Verification"; StringBuilder sb = new StringBuilder(); sb.Append("<html>"); sb.Append("<body>"); sb.Append("<p>Dear ,</p>"); sb.Append("<p>Please click the below link to verify your email.</p><br>"); sb.Append("<a href='http://localhost:4200/Emailverification/" + _email + "/" + _userId + "'>click here</a>"); sb.Append("<p>Sincerely,<br>-Offey</br>...

How to upload assets to AWS presignedurl from ClientSide javascrript

Image
Clash Royale CLAN TAG #URR8PPP How to upload assets to AWS presignedurl from ClientSide javascrript I am approching presignedUrl method to upload a large file . I call an API from my angular code to server side which gives me presignedUrl , then I need to upload an URL . I have some question on this 1) Is there need to AWS SDK on my Angular side ? I assume I dont need it , I just sent PUT request to unsigned URL and file uploadfileAWSS3old(e,f){ const formData = new FormData(); formData.append("data",JSON.stringify({name:"testname"})); formData.append("file", f.files[0]); let contentType = f.files["0"].type; const headers = new HttpHeaders( { 'Content-Type': contentType }); const req = new HttpRequest('PUT',this.URL,formData, { headers: headers, reportProgress: true, //This is required for track upload process }); console.log(req) this.http.r...

What does “@” symbol mean in “import { Component } from '@angular/core';” statement?

Image
Clash Royale CLAN TAG #URR8PPP What does “@” symbol mean in “import { Component } from '@angular/core';” statement? I'm reading Angular 2 "5 Min Quickstart" and there is such a line: import { Component } from '@angular/core';" I can't figure out, what does @ symbol make in that import? TypeScript docs are also doesn't say anything about that. @ What does it mean? Possible duplicate of Understanding npm package @-prefix: @angular/router – Ankit Singh May 22 '16 at 9:57 your name sounds like Bill Gates :p – Ankush Jain Sep 3 '16 at 16:35 3 Answers 3 this is ju...

is there any component to check tree view comparison in angular 4

Image
Clash Royale CLAN TAG #URR8PPP is there any component to check tree view comparison in angular 4 may I know why I got downvote please? – Ashok Kumar N 6 mins ago By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Editable field saved to database

Image
Clash Royale CLAN TAG #URR8PPP Editable field saved to database I've got this editable field. I need it to save the new data and store it in the database. HTML: <ng-container *ngIf="groupedVolumes"> <ng-container *ngFor="let model of groupKeys() | slice:-3" > <tr> <th class="model">{{ carValues(model)[0].model }}</th> <ng-container *ngFor="let value of carValues(model)"> <td contenteditable='true' class="data"> {{ value.scheduledVolume }} </td> </ng-container> </tr> </ng-container> </ng-container> The HTML data sh...

Angular - Disable datepicker after toggle switch

Image
Clash Royale CLAN TAG #URR8PPP Angular - Disable datepicker after toggle switch I'm using angular material. I want to disable datepicker after switching slide toggle. My upload form with datepicker: <form #uploadForm="ngForm" (keydown.enter)="$event.preventDefault()" (ngSubmit)="upload(uploadForm.valid)"> <div class="input-wrapper"> <mat-form-field> <input id="date" name="date" [(ngModel)]="model.date" [disabled]="uploadForm.submitted" [matDatepicker]="datepicker" [matDatepickerFilter]="dateFilter" [min]="minDate" [max]="maxDate" placeholder="Expiration date" #date="ngModel" autocomplete="off" matInput readonly required /> <mat-datepicker-toggle matSuffix [for]="datepicker...

No Angular syntax coloration in Intellij

Image
Clash Royale CLAN TAG #URR8PPP No Angular syntax coloration in Intellij I recently imported an existing project into IntelliJ that uses Angular6+ and Typescript. Unfortunately, I can't get the syntax coloration to work as expected (see image below), even though IntelliJ did recognize Typescript at some point and I downloaded the AngularJS plugin from this adress and copied it in the Idea > plugins folder. I then followed this Jet Brains Angular page but I still don't see coloration in my code (you can however see what I expect on the capture "Generating code with Angular Schematics"). Has anyone ever experienced the same problem ? Thanks in advance for any help you can provide ! [edit] Here's the image of what I get : Syntax coloration no working Are you using IntelliJ IDEA Ultimate? – yole 23 hours ago ...

401 status error on API request

Image
Clash Royale CLAN TAG #URR8PPP 401 status error on API request I always get this error when trying to implement simple web service that displays just a msg (angular5 + spring boot) this is the error :vendor.bundle.js:62557 ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: "OK", url: "localhost:8080/hello";, ok: false, …} error : "... headers : HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ} message : "Http failure response for localhost:8080/hello: 401 OK" name : "HttpErrorResponse" ok : false status : 401 statusText : "OK" url : "localhost:8080/hello"; this is my simple code: controller.java: @GetMapping("/hello") public String sayhello(){ return "{"message": "Hello, world!"}";} } hello.component.ts: import { Component, OnInit } from '@angular/core'; import { HttpClient, HttpErrorResponse, HttpParams } from ...

filter typescript array based on another array

Image
Clash Royale CLAN TAG #URR8PPP filter typescript array based on another array There are several examples of this based on simple arrays, but I have 2 arrays of objects and cannot seem to get this to work. getAvailableApplications() : Application { var list; if (!this.userSettings) list = this.applications; else list = this.applications.filter(x=> this.userSettings.modules.filter(y=> x.entityId === y.moduleId )); return list; } This is always returning me the complete list of applications, and not removing ones that are not in the userSetting.modules array, despite the fact that I have an element in the userSettings.modules array. I also tried rewriting without lambdas, but it doesn't seem to recognise the module level userSettings variable this.applications.filter(function (x){ return this.userSettings.filter(function(y){ return x.entityId === y.moduleId; }) userSettings is declared as any, but is assigned a va...

ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: “OK”, url: “http://localhost:8080/hello”, ok: false, …}

Image
Clash Royale CLAN TAG #URR8PPP ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: “OK”, url: “http://localhost:8080/hello”, ok: false, …} I alwaaays get this error when trying to implement simple web service that display just a msg (angular5 + spring boot) the error shown is in this img this is my simple code: controller.java: @GetMapping("/hello") public String sayhello(){ return "{"message": "Hello, world!"}";} } hello.component.ts: import { Component, OnInit } from '@angular/core'; import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Rx'; import { Adresse } from '../shared/adresse'; @Component({ selector: 'app-forgot', templateUrl: './forgot.component.html', styleUrls: ['./forgot.component.css'] }) export class ForgotComponent implements OnInit { ...

Angular ternary condition with keydown.space and keydown.tab

Image
Clash Royale CLAN TAG #URR8PPP Angular ternary condition with keydown.space and keydown.tab What I want is to check if a input type is of a particular type only then apply the check of keydown.space and keydown.tab keydown.space keydown.tab What I tried: <input (keydown.space)="locationUi.location_type=='video' ? $event.preventDefault() : false" (keydown.tab)="locationUi.location_type=='video' ? $event.preventDefault(): false" id="masked-input" [ngClass]="locationUi.location_type=='video' ? 'width-40':''" (input)="textInput()" type="{{locationUi.extra.field.type}}" name="inputOtherAdress" class="form-control" placeholder="{{locationUi.extra.field.placeholder}}" [required]="locationUi.enabled" [value]="locationUi.data" (input)="locationUi.data = $event.target.value"> Results: this disables the spaces and tabs ...

Angular 5 must click to continue after HTTP Post request

Image
Clash Royale CLAN TAG #URR8PPP Angular 5 must click to continue after HTTP Post request I am working on an Angular 5 component that includes "ngx-file-drop" and "ngx-spinner" modules. The issue appears after the upload of a file via my API. The file is correctly uploaded, and on my subscribe function, it shows correctly the console.log line but not the others, so I have to click on the screen to continue. in the code below, I tried to add an eventEmitter to handle the and of the upload. It is correctly triggered but the "this.spinner.hide() and this.entryFile = null" are not executed until I click on the screen. import { Component, OnInit, EventEmitter } from '@angular/core'; import { FileSystemDirectoryEntry, UploadFile, FileSystemFileEntry, UploadEvent } from 'ngx-file-drop'; import { TranslateService } from '@ngx-translate/core'; import {NgxSpinnerService} from 'ngx-spinner'; import { HttpClient } from '@angular/commo...

Bootstrap columns not working[1]

Image
Clash Royale CLAN TAG #URR8PPP Bootstrap columns not working[1] Below are the two html files and i am using bootstrap i both of them but i am not able to figure out why bootstrap columns are not working recipies.component.html <div class="row"> <div class="col-md-5"> <app-recipie-list></app-recipie-list> </div> <div class="col-md-7"> <app-recipie-detail></app-recipie-detail> </div> </div> app.component.html <app-header></app-header> <div class="container"> <div class="row"> <div class="col-md-12"> <app-recipies></app-recipies> <app-shopping-list></app-shopping-list> </div> </div> </div> can someone tell me what is the error???? do you install bootstrap to your project? – לבני מלכה 2 mins ago ...

How we can import conditional css file for particular html page in Angular4 application?

Image
Clash Royale CLAN TAG #URR8PPP How we can import conditional css file for particular html page in Angular4 application? For example,I have two css A and B, I want to apply css A to xyz1 page and css B to xyz2 page. So, how can I add the condition to do the same? It should work on IE also. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

CCAvenue Integration in Angular 1

Image
Clash Royale CLAN TAG #URR8PPP CCAvenue Integration in Angular 1 i am a fresher for angular,i need to integrate CCAvenue in angular 1 version,please help me and suggest example url i saw this link but it was work from angular 2 version,please help some example By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

In angular grid, I have a column with an editor template (reactive form) in inline Kendo grid. It doesn't link template control (textbox) and the form

Image
Clash Royale CLAN TAG #URR8PPP In angular grid, I have a column with an editor template (reactive form) in inline Kendo grid. It doesn't link template control (textbox) and the form In kendo grid, I have a column with an editor template (reactive form). It doesn't link template control (textbox) and the form, because of that changes are not getting reflected in the grid and not binding the template to the model. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.