angular8

Can we change root APIURL in angular 8 without building project with environment development or production from CLI

馋奶兔 提交于 2021-02-17 05:48:13
问题 Do we need to build project two times with prod and development, or is there any other way to change the root URL of API pointed on different server and root url change without building the project. 回答1: We can create a config.json file in project directory and in app.component.ts read the new configuration setting without rebuilding the project. I got solution here https://github.com/angular/angular-cli/issues/12442 回答2: I don't understand why a lot of people keep their API URL root in

Wait for Service Api call to complete in Angular 8

ⅰ亾dé卋堺 提交于 2021-02-11 15:26:53
问题 I am trying my first Angular 8 Crud Web app and wrote a page to list some company names from WebApi My Service is correctly getting data and Iam able to print it on console //Service.ts export class CompanyService { allCompanys: Company[] constructor(private httpClient: HttpClient) { } // Returns all the companys GetAll(): Company[] { this.httpClient.get<Company[]>('https://localhost:565656/api/company').subscribe(result => { this.allCompanys = result; //Shows data Sucessfully from Server

Angular 8 is not loading in IE 11 Browser

五迷三道 提交于 2021-02-11 14:10:36
问题 It is a duplicate question from How do I support Internet Explorer in an Angular 8 application? But I really wondering why none of the solution is not working for me including nested forum sites solutions too.Here are my snippets FYI.have tried a lot and being spending two days for this before posting here. curious to know what i missed and what will be the solution. much appreciated if get the expected solution. package.json "dependencies": { "@angular/animations": "^8.2.3", "@angular/cdk":

using mqtt-ngx to connet in tls via websocket to a broker

倖福魔咒の 提交于 2021-02-11 13:51:40
问题 I have a remote mosquitto broker (on a aws ec2 instance with windows) and everything is working fine: the ports are accessible and i can publish and subscribe with the rules of my acl. I've limited the publish operation to my .net core server (with identityserver 4), while my angular8 app with ngx-mqtt subscribes. Now i'm trying to enable tls, but it keep failing on connecting. main-es2015.42b21e2ecd07be623604.js:1 WebSocket connection to 'wss://myserver/mqtt' failed: Error in connection

zoom in & zoom out angular not working for ngx-image-cropper

霸气de小男生 提交于 2021-02-11 12:49:54
问题 I am trying for Zoomin & Zoom out from ngx-image-cropper I am not getting any error but when i click the button zoomOut or ZoomIn it's not working. please let me know what I am doing wrong here. Team please help me here my TS code zoomOut() { this.scale -= .1; this.transform = { ...this.transform, scale: this.scale }; } zoomIn() { this.scale += .1; this.transform = { ...this.transform, scale: this.scale }; } My HTML Code <button class="btn zoomIn" (click)="zoomIn()" tooltip="Zoom In" data

svg-sprite-loader with Angular 8 custom webpack config

佐手、 提交于 2021-02-10 20:31:46
问题 I am trying to use svg-sprite-loader package (to create a svg sprite) with my Angular 8 project using custom webpack config. I am using below custom config: const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); module.exports = { module: { rules: [ { test: /\.(svg)$/, loader: 'svg-sprite-loader', options: { spriteFilename: './src/assets/svg/combinedicons.svg', runtimeCompat: true, }, }, ], }, plugins: [ new SpriteLoaderPlugin({ plainSprite: true, }), ], }; I am getting following

svg-sprite-loader with Angular 8 custom webpack config

谁说胖子不能爱 提交于 2021-02-10 20:29:38
问题 I am trying to use svg-sprite-loader package (to create a svg sprite) with my Angular 8 project using custom webpack config. I am using below custom config: const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); module.exports = { module: { rules: [ { test: /\.(svg)$/, loader: 'svg-sprite-loader', options: { spriteFilename: './src/assets/svg/combinedicons.svg', runtimeCompat: true, }, }, ], }, plugins: [ new SpriteLoaderPlugin({ plainSprite: true, }), ], }; I am getting following

Changing color of mat form ripple conditionally

爱⌒轻易说出口 提交于 2021-02-10 14:57:10
问题 I am working on a angular app. I am using mat-form-field as follows. <mat-form-field appearance="fill"> <mat-label id="title">{{ title }} </mat-label> <input formControlName="title" matInput id="title" (click)='updateValue("title")' readonly> </mat-form-field> I get a rectangle shaped form field with above code. When I hover over the bottom line of mat form field like when I take my mouse on bottom of a particular form field I want to change color. For it I am suing following CSS .mat-form

Changing color of mat form ripple conditionally

蓝咒 提交于 2021-02-10 14:56:22
问题 I am working on a angular app. I am using mat-form-field as follows. <mat-form-field appearance="fill"> <mat-label id="title">{{ title }} </mat-label> <input formControlName="title" matInput id="title" (click)='updateValue("title")' readonly> </mat-form-field> I get a rectangle shaped form field with above code. When I hover over the bottom line of mat form field like when I take my mouse on bottom of a particular form field I want to change color. For it I am suing following CSS .mat-form

How to check the response or status code in angular 8 for upload file to S3 Presigned URL and statusCode is 200

只愿长相守 提交于 2021-02-07 08:54:36
问题 Request to upload file: // upload file to the pre-signed url const httpOptions = { headers: new HttpHeaders({ 'Content-Disposition': 'attachment;filename=' + file.name + '', observe: 'response' }) }; this.httpClient.put(preSingedUrl, file, httpOptions) .subscribe((response: HttpResponse<any>) => { console.log(response); // it's returning null }); response is always getting null, but in the network tab status is 200 OK. access-control-allow-methods: GET, POST, OPTIONS access-control-allow