typescript2.4

Observable.forkJoin() TS2322 error after updating to TypeScript 2.4.1 and Rxjs 5.4.2

给你一囗甜甜゛ 提交于 2020-01-24 14:14:25
问题 In our angular 4.2.4 application, we use RxJS's Observable.forkJoin in a number of places to return heterogeneous types. For example: private fleet: Aircraft[]; private contractList: string[]; Observable.forkJoin([ this.fleetService.getFleet(), this.fleetService.getContractList() ]).subscribe( next => { this.fleet = results[0]; this.contractList = results[1]; }, error => console.error ); with the following service signatures: getFleet(): Observable<Aircraft[]> { ... } getContractList():

Could not find Angular Material core theme

ぃ、小莉子 提交于 2019-12-11 03:55:23
问题 I have added angular material2 package to my project. However, I get the following warning message in browser i have created a custom scss file and imported the packages still it throw's warning message: Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: material.es5.js?7d89:180 https://material.angular.io/guide/theming I have created styles.scss file and included following configuration file Package "

Download a webpage in pdf format using angular4

99封情书 提交于 2019-12-10 18:37:07
问题 I am new for angular 4. I need to download a HTML webpage in pdf format and the html webpage contains angular controls like input [(ngModel)] , radio button [checked] . Rather than showing the control values it shows undefined in the pdf file. I tried using jsPdf & html2Pdf But it throws error Error: You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js at Object.jsPDFAPI.addHTML (jspdf.debug.js?6964:4049) Code for TS File: import { Component,

TypeScript ES dynamic `import()`

℡╲_俬逩灬. 提交于 2019-12-08 18:47:49
问题 While using the new TypeScript feature, so called ES Dynamic Imports, I am not able to run the code of my isomorphic app on the server side using ts-node . It seems like the error does not occur when using the webpack module loader which transpiles the code in it's own way and running resulting files in a browser. The error which I've got: case 0: return [4 /*yield*/, import("./component/main")]; ^^^^^^ SyntaxError: Unexpected token import Usually TypeScript transpiles the import expression

TypeScript's string enums - “Type … is not assignable to type …”

你说的曾经没有我的故事 提交于 2019-11-28 13:15:30
I have recently upgraded the version of TypeScript from 2.3.4 to 2.4.0 hoping to use the string enums . To my dismay, however, I have been greeted with the error messages: Severity Code Description Project File Line Suppression State Error TS2322 Type '"E"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 17 Active Error TS2322 Type '"S"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 14 Active Error TS2322 Type '"A"' is not assignable to

How do I get around this “Subject incorrectly extends Observable” error in TypeScript 2.4 and RxJS 5.x?

*爱你&永不变心* 提交于 2019-11-27 19:36:01
When I compile, I get the following compiler error in the RxJS declaration files: node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'. Types of property 'lift' are incompatible. Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'. Type 'Observable<T>' is not assignable to type 'Observable<R>'. Type 'T' is not assignable to type 'R'. What's going on here, and how do I get around this without downgrading to TypeScript 2.3 or earlier? Solution RxJS 5.4.2

TypeScript's string enums - “Type … is not assignable to type …”

妖精的绣舞 提交于 2019-11-27 07:43:14
问题 I have recently upgraded the version of TypeScript from 2.3.4 to 2.4.0 hoping to use the string enums. To my dismay, however, I have been greeted with the error messages: Severity Code Description Project File Line Suppression State Error TS2322 Type '"E"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 17 Active Error TS2322 Type '"S"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART

How do I get around this “Subject incorrectly extends Observable” error in TypeScript 2.4 and RxJS 5.x?

核能气质少年 提交于 2019-11-26 22:49:22
问题 When I compile, I get the following compiler error in the RxJS declaration files: node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'. Types of property 'lift' are incompatible. Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'. Type 'Observable<T>' is not assignable to type 'Observable<R>'. Type 'T' is not assignable to type 'R'. What's going on