Cleanest way to reset forms

Add a reference to the ngForm directive in your html code and this gives you access to the form, so you can use .resetForm(). …Or pass the form to a function: The difference between resetForm and reset is that the former will clear the form fields as well as any validation, while the later will only clear the fields. Use resetForm after the form … Read more

Error when trying to inject a service into an angular component “EXCEPTION: Can’t resolve all parameters for component”, why?

Import it from the file where it is declared directly instead of the barrel. I don’t know what exactly causes the issue but I saw it mentioned several times (probably some kind of circular dependency). It should also be fixable by changing the order of the exports in the barrel (don’t know details, but was … Read more

Angular2 Error: There is no directive with “exportAs” set to “ngForm”

Since 2.0.0.rc6: forms: deprecated provideForms() and disableDeprecatedForms() functions have been removed. Please import the FormsModule or the ReactiveFormsModule from @angular/forms instead. In short: If you use template-driven forms, add FormsModule to your @NgModule. If you use model-driven forms, add ReactiveFormsModule to your @NgModule. So, add to your app.module.ts or equivalent: Failing to have one of … Read more

how to refresh page in angular 2

I have created one router link as below. This router link loads ProductsStartComponent and then this component loads several other components using ngif and not via navigation. Since below Product categories link is visible in all pages so if I am clicking on this link after reaching to some component of ngif , this is … Read more

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