angular6

How to keep observable alive after error in RxJS 6 and Angular 6

限于喜欢 提交于 2019-12-21 21:41:24
问题 Can anyone help with the scenario where this._getReactions$.next() not working whenever this.http.get(...) gets an error. I want to keep observable alive to take the next input. private _getReactions$: Subject<any> = new Subject(); constructor() { this._getReactions$ .pipe( switchMap(() => { return this.http.get(...) // http request }), catchError(error => { console.log(error); return empty(); }) ) .subscribe(data => { console.log(data) //results handling }); } onClick() { this._getReactions$

Angular 6 Application Breaks on reload after production build

泄露秘密 提交于 2019-12-21 20:48:57
问题 I have an application where i have kept that dist folder which we get after success full production build on my server. All works fine all modules & components are working perfectly. Untill I reload the browser window manually, it throws the below errors. Also i have build the project using base-href -- /dist/ Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please

How to change the direction of the columns in the Angular Material table?

老子叫甜甜 提交于 2019-12-21 20:46:27
问题 Does anyone know how in the table from this example: https://stackblitz.com/angular/dlxbkjqaoba?file=app%2Ftable-basic-example.ts Make it so that the columns are directed horizontally, roughly like in the picture: 回答1: You can use invert the table in an ngOnInit() method in the class to give the required data structure and then iterate over the column list in the HTML to give the required columns. Below is an example: ts file: import {Component, OnInit} from '@angular/core'; /** * @title

Can't update angular to version 6

让人想犯罪 __ 提交于 2019-12-21 13:16:21
问题 I'm trying to update angular to latest version . I have updated global @angular/cli npm install -g @angular/cli Then when I try to update local @angular/cli using ng update @angular/cli I get this error: Error: Unexpected end of JSON input Unexpected end of JSON input Here's my package.json { "name": "apimap", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true,

Can't update angular to version 6

馋奶兔 提交于 2019-12-21 13:12:11
问题 I'm trying to update angular to latest version . I have updated global @angular/cli npm install -g @angular/cli Then when I try to update local @angular/cli using ng update @angular/cli I get this error: Error: Unexpected end of JSON input Unexpected end of JSON input Here's my package.json { "name": "apimap", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true,

Angular 6 Update - rxjs-5-to-6-migrate command not found

Deadly 提交于 2019-12-21 07:26:18
问题 In the upgrade process from update.angular.io: Remove deprecated RxJS 6 features using rxjs-tslint auto update rules. For most applications this will mean running the following two commands: npm install -g rxjs-tslint rxjs-5-to-6-migrate -p src/tsconfig.app.json But when I follow these steps and run rxjs-5-to-6-migrate -p src/tsconfig.app.json I'm getting the error: rxjs-5-to-6-migrate: command not found Is there any reason why this command isn't working? 回答1: I did get it working and my

Convert HTML to PDF in Angular 6

三世轮回 提交于 2019-12-21 07:09:54
问题 I have a component (Angular 6) which is an aggregation of several components. This produces a long HTML (I am using Bootstrap 4). Now I want to convert this HTML to PDF. I have searched far and wide and found many solutions that work on jsPDF. The requirement is to produce a crisp layout as it appears in the HTML (so that users can select, copy, etc). But the solutions I found either try to add lines of text manually, which is impossible in my scenario; or they convert (rasterize?) the HTML

Error: Schema validation failed with the following errors: Data path “” should NOT have additional properties(project)

情到浓时终转凉″ 提交于 2019-12-21 06:50:06
问题 After migrating application from angular 5 to 6, on running ng serve the following errors pop up. Schema validation failed with the following errors: Data path "" should NOT have additional properties(project). Error: Schema validation failed with the following errors: Data path "" should NOT have additional properties(project). at MergeMapSubscriber._registry.compile.pipe.operators_1.concatMap.validatorResult [as project] (.../TemplateApp/me-cmf-web-template-angular/node_modules/@angular

Angular 6 Boilerplate with only Basic Features (Required all the time)?

橙三吉。 提交于 2019-12-21 05:58:32
问题 I Setup Angular all the time with new Project. Anyone can suggest good boilerplate where no need to develop Basic required features which are required most of the times in a application. JWT Authentication in Angular 6 Bootstrap/Material Design setup in Angular 6 Http Services in Angular 6 File Uploading in Angular 6 Basic CRUD in Angular 6 Please suggest. It will save my lot of time. 回答1: You can follow this boilerplate https://github.com/brnrajoriya/Angular-Ready-To-Use-Boilerplate Just

Angular 6 Boilerplate with only Basic Features (Required all the time)?

有些话、适合烂在心里 提交于 2019-12-21 05:58:01
问题 I Setup Angular all the time with new Project. Anyone can suggest good boilerplate where no need to develop Basic required features which are required most of the times in a application. JWT Authentication in Angular 6 Bootstrap/Material Design setup in Angular 6 Http Services in Angular 6 File Uploading in Angular 6 Basic CRUD in Angular 6 Please suggest. It will save my lot of time. 回答1: You can follow this boilerplate https://github.com/brnrajoriya/Angular-Ready-To-Use-Boilerplate Just