angular


angular - TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable

In my case the error occurred only during e2e tests. It was caused by throwError in my AuthenticationInterceptor. I imported it from a wrong source because I used WebStorm's import feature. I am usin... Read More


javascript - Avoid Angular2 to systematically submit form on button click

I see two options to solve it: 1) Specify type="button" explicitly (i think it's more preferable ): <button type="button" (click)="preview();">Preview</button> According to W3 specification: http://... Read More


How to make an angular module to ignore http interceptor added in a core module

You can use HttpBackend. Example: import { HttpClient, ..., HttpBackend } from '@angular/common/http'; @Injectable() export class TestService { private httpClient: HttpClient; constructor( han... Read More


angular - No provider for TemplateRef! (NgIf ->TemplateRef)

You missed the * in front of NgIf (like we all have, dozens of times): <div *ngIf="answer.accepted">&#10004;</div> Without the *, Angular sees that the ngIf directive is being applied to the div el... Read More


node.js - Angular2 QuickStart npm start is not working correctly

Change the start field in package.json from "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" " to "start": "concurrently \"npm run tsc:w\" \"npm run lite\" "... Read More


angular - What is difference between ng build and ng serve?

The ng build command is intentionally for building the apps and deploying the build artifacts. The ng serve command is intentionally for fast, local and iterative developments and also for builds, w... Read More


angular - Do I have to unsubscribe from ActivatedRoute (e.g. params) observables?

From the docs : When subscribing to an observable in a component, you almost always arrange to unsubscribe when the component is destroyed. There are a few exceptional observables where this is not n... Read More


typescript - Angular 2 two way binding using ngModel is not working

Angular has released its final version on 15th of September. Unlike Angular 1 you can use ngModel directive in Angular 2 for two way data binding, but you need write it in a bit different way like [(... Read More


angular - No provider for Http StaticInjectorError

In order to use Http in your app you will need to add the HttpModule to your app.module.ts: import { BrowserModule } from '@angular/platform-browser'; import { NgModule, ErrorHandler } from '@angular... Read More


How to decode the JWT encoded token payload on client-side in angular 5?

I use jwt-decode package for decoding JWT token in angular 5; this package work me fine. after install package through this command: npm install jwt-decode import this package into your TypeScript cl... Read More