angular8

Extending HttpErrorResponse leads to error Cannot find module '@angular/common/http'

最后都变了- 提交于 2020-06-17 22:54:33
问题 I have a model (defined in separate file) which extends HttpErrorResponse with custom property. Custom property is an interface with few properties: import { HttpErrorResponse } from '@angular/common/http'; export interface ApiErrorBody { id: number; code: string; message?: string; trace?: string; } export class ApiErrorResponse extends HttpErrorResponse { public error: ApiErrorBody; } This code works fine in debug mode, but when compiling to prod, I see error at runtime: Error: Cannot find

AddInMemoryClients results in Unknown client or not enabled

独自空忆成欢 提交于 2020-06-16 16:59:17
问题 I'm trying to get Identity server 4 to work in an ASP Net Core 3 application with an Angular 8 SPA using "oidc-client": "1.10.1" . If I add the following to my appsettings.json "IdentityServer": { "Key": { "Type": "File", "FilePath": "acertificate.pfx", "Password": "notmyrealpassword..orisit?" }, "Clients": { "dev-client": { "Profile": "IdentityServerSPA", } } } Using this client: { authority: 'https://localhost:5001/', client_id: 'dev-client', redirect_uri: 'http://localhost:4200/auth

AddInMemoryClients results in Unknown client or not enabled

限于喜欢 提交于 2020-06-16 16:59:07
问题 I'm trying to get Identity server 4 to work in an ASP Net Core 3 application with an Angular 8 SPA using "oidc-client": "1.10.1" . If I add the following to my appsettings.json "IdentityServer": { "Key": { "Type": "File", "FilePath": "acertificate.pfx", "Password": "notmyrealpassword..orisit?" }, "Clients": { "dev-client": { "Profile": "IdentityServerSPA", } } } Using this client: { authority: 'https://localhost:5001/', client_id: 'dev-client', redirect_uri: 'http://localhost:4200/auth

AddInMemoryClients results in Unknown client or not enabled

我怕爱的太早我们不能终老 提交于 2020-06-16 16:57:18
问题 I'm trying to get Identity server 4 to work in an ASP Net Core 3 application with an Angular 8 SPA using "oidc-client": "1.10.1" . If I add the following to my appsettings.json "IdentityServer": { "Key": { "Type": "File", "FilePath": "acertificate.pfx", "Password": "notmyrealpassword..orisit?" }, "Clients": { "dev-client": { "Profile": "IdentityServerSPA", } } } Using this client: { authority: 'https://localhost:5001/', client_id: 'dev-client', redirect_uri: 'http://localhost:4200/auth

Angular - Failed to load module script:

可紊 提交于 2020-06-13 06:20:07
问题 I have angular 8 front end application in production and its Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. This issue is happening only in production build that too not always , able reproduce only sometimes. main-es2015.fcc7123d15fd9c113b00.js:1 vendor-es2015.d8d7d81cc2b06ece8c91.js:1 How do i fix it.? 回答1: Are you using serviceWorker? If so you have to add inside

Angular App not serving latest build files to end users

强颜欢笑 提交于 2020-06-13 05:33:06
问题 I have an Angular Web App that has more frequent changes so when I build and publish to IIS, app is not serving latest build files to end users. It is required to press Ctrl + F5 to get new files from the server. I use below CLI command to produce build files. I use Angular 8. ng build --aot --outputHashing=bundles --prod Should I add any other parameter for this? 回答1: I had a similar problem and discovered it comes from the web server (Apache in my case). When you deploy the app on

How to fix this error Type 'number' has no properties in common with type 'XrangePointOptionsObject'

落花浮王杯 提交于 2020-06-09 05:38:08
问题 I'm getting this error Type 'number' has no properties in common with type 'XrangePointOptionsObject'. I want to add bar chart using angular highchatrs in my angular project but I'm not able to add because of this error. So can you please help me to solve this error. Thanks. this is my component.ts file import { Chart } from 'angular-highcharts'; import * as Highcharts from 'highcharts' @Component({ selector: 'app-bar-chart', templateUrl: './bar-chart.component.html', styleUrls: ['./bar-chart

How to compile runtime-generated Angular8 code?

风格不统一 提交于 2020-06-08 12:40:37
问题 I'm creating Angular code at runtime, in particular, I use a SVG library in order to create a vector graphic that contains Angular code directives like (click)='myMethod()' , which, in turn, call methods I've statically defined in the SVG-enclosing component. Being generated at runtime I need to compile the created template and add it to a component. I implemented such code back then with Angular 3 with the help of this post which was quite cumbersome. I tried to the copy the old code in an

How to compile runtime-generated Angular8 code?

白昼怎懂夜的黑 提交于 2020-06-08 12:40:28
问题 I'm creating Angular code at runtime, in particular, I use a SVG library in order to create a vector graphic that contains Angular code directives like (click)='myMethod()' , which, in turn, call methods I've statically defined in the SVG-enclosing component. Being generated at runtime I need to compile the created template and add it to a component. I implemented such code back then with Angular 3 with the help of this post which was quite cumbersome. I tried to the copy the old code in an

Lazy-loaded modules warnings after updating Angular from 8 to 9

我是研究僧i 提交于 2020-06-01 07:03:39
问题 After Angular update all lazy-loaded modules return warning: Error: [path/to/module/module-name.ts] is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. My function which returns modules array: export function manifests(prefix = '') { return [ { loadChildren: () => import(prefix + '/path/to/a.module').then(m => m.AModule), path: 'a', }, { loadChildren: () => import(prefix + '/path/to/b.module').then(m => m.BModule), path: