Angular 4 HttpClient Query Parameters

I have been looking for a way to pass query parameters into an API call with the new HttpClientModule‘s HttpClient and have yet to find a solution. With the old Http module you would write something like this. getNamespaceLogs(logNamespace) { // Setup log namespace query parameter let params = new URLSearchParams(); params.set(‘logNamespace’, logNamespace); this._Http.get(`${API_URL}/api/v1/data/logs`, { … Read more

How to extend / inherit components?

I would like to create extensions for some components already deployed in Angular 2, without having to rewrite them almost completely, as the base component could undergo changes and wish these changes were also reflected in its derived components. I created this simple example to try to explain better my questions: With the following base … Read more

What are the practical differences between template-driven and reactive forms?

I have been reading about Angular2 new Forms API and it seems that there are two approaches on forms, one is Template driven forms other is reactive or model-driven forms. I would like to know the practical difference between the two, not the difference in syntax (obviously) but practical uses and which approach benefits more … Read more

Angular 2 ‘component’ is not a known element

I’m trying to use a component I created inside the AppModule in other modules. I get the following error though: “Uncaught (in promise): Error: Template parse errors: ‘contacts-box’ is not a known element: If ‘contacts-box’ is an Angular component, then verify that it is part of this module. If ‘contacts-box’ is a Web Component then … Read more

‘Found the synthetic property @panelState. Please include either “BrowserAnimationsModule” or “NoopAnimationsModule” in your application.’

I upgraded an Angular 4 project using angular-seed and now get the error Found the synthetic property @panelState. Please include either “BrowserAnimationsModule” or “NoopAnimationsModule” in your application. How can I fix this? What exactly is the error message telling me? 14 Answers 14

Angular 2.0 router not working on reloading the browser

I am using Angular 2.0.0-alpha.30 version. When redirect to a different route, then refresh the browser , its showing Cannot GET /route. Can you help me with figuring why this error happened. 32 Answers 32 The error you are seeing is because you are requesting http://localhost/route which doesn’t exist. According to Simon. When using html5 … Read more

Property ‘of’ does not exist on type ‘typeof Observable [duplicate]

This question already has answers here: Observable.of is not a function (18 answers) Closed 5 years ago. I was recently using observable on my authentication token like Observable.of(‘token’); But it keeps giving me above mentioned error, though i have already imported this. import {Observable} from ‘rxjs/Observable’; 1 Answer 1