Angular 2/4: Resolved poblem with Error encountered resolving symbol values statically. Calling function ‘ɵmakeDecorator’


Porblem when try to build on server with : "build:prod": "ng build --prod"   Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in@angular/core/core.d.ts, resolving symbol ɵf in @angular/core/core.d.ts, resolving symbol ɵf in @angular/core/core.d.ts … Continue reading Angular 2/4: Resolved poblem with Error encountered resolving symbol values statically. Calling function ‘ɵmakeDecorator’

Argument of type ‘HttpStatus’ is not assignable to parameter of type ‘(resolve: (value?: {} | Thenable) => void, reject: (reason?: any) => void) => any’. Type ‘HttpStatus’ provides no match for the signature ‘(resolve: (value?: {} | Thenable) => void, reject: (reason?: any) => void): any’.


Two way to resolved this problem: Change index.d.ts function resolve<T>(value?: T | Thenable<T>): Promise<T>; This is a bad type definition. It makes the claim that for any type T, you can call the function with 0 arguments, and get a promise that resolves to T. Which is: generally not what one intends by calling Promise.resolve() … Continue reading Argument of type ‘HttpStatus’ is not assignable to parameter of type ‘(resolve: (value?: {} | Thenable) => void, reject: (reason?: any) => void) => any’. Type ‘HttpStatus’ provides no match for the signature ‘(resolve: (value?: {} | Thenable) => void, reject: (reason?: any) => void): any’.

Catching global errors in Angular 2 with ErrorHandler


Angular 2 already has a very good error handler. When an error randomly occurs in your code, the Angular’s error handler will catch it and will print the error details in the console. The error details will also include the line number with a link to the source file. In most cases this should be … Continue reading Catching global errors in Angular 2 with ErrorHandler

Angular2 call method of other component /Module


You can create one service which is shared between your header and form component in which you can define Observable so that you can subscribe to that Observable from form and perform some action when you receive some value from header. //common.service.ts import { Injectable, Inject } from '@angular/core'; import { Subject } from 'rxjs/Subject'; … Continue reading Angular2 call method of other component /Module

Async/Await with Angular 2


TypeScript 2.1 was officially announced yesterday, and the biggest feature in this release is probably full support for async/await. So what’s async/await? It’s a proposed JavaScript feature officially known as Async Functions, but in a nutshell it’s some syntactic sugar that makes working with asynchronous promises look like sequential code. (If you’re not familiar with … Continue reading Async/Await with Angular 2

Async/Await with Promise in Node Express and TypeScript 2


In this tutorial i will try to implement async/await with promise in typescript 2. Step1: First of all we need to config for tsconfig.json Focus on hightligth text "compilerOptions": { "target": "es6", "lib": ["es2015", "es2016", "dom", "es2017", "es6", "es5"], // "lib": ["es6", "dom"], //"outDir": "./**/*", // use this for building out to a differen't directory' … Continue reading Async/Await with Promise in Node Express and TypeScript 2