How to use `@ts-ignore` for a block?

You can’t. As a workaround you can use a // @ts-nocheck comment at the top of a file to disable type-checking for that file: https://devblogs.microsoft.com/typescript/announcing-typescript-3-7-beta/ So to disable checking for a block (function, class, etc.), you can move it into its own file, then use the comment/flag above. (This isn’t as flexible as block-based disabling … Read more

How do I decide whether @types/* goes into `dependencies` or `devDependencies`?

Let’s say you’re developing a package “A” that have @types/some-module package in devDependencies. For some reason you’re exporting the type from @types/some-module: import { SomeType } from ‘some-module’; export default class APackageClass { constructor(private config: SomeType) { // … } } Right now TypeScript consumers of package “A” are unable to guess what SomeType is, … Read more

Expression ___ has changed after it was checked

As stated by drewmoore, the proper solution in this case is to manually trigger change detection for the current component. This is done using the detectChanges() method of the ChangeDetectorRef object (imported from angular2/core), or its markForCheck() method, which also makes any parent components update. Relevant example: import { Component, ChangeDetectorRef, AfterViewInit } from ‘angular2/core’ … Read more

How to pass optional parameters while omitting some other optional parameters?

As specified in the documentation, use undefined: export interface INotificationService { error(message: string, title?: string, autoHideAfter? : number); } class X { error(message: string, title?: string, autoHideAfter?: number) { console.log(message, title, autoHideAfter); } } new X().error(“hi there”, undefined, 1000); Playground link.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)