mat-form-field must contain a MatFormFieldControl

Import MatInputModule in your module.ts file and it will solve the problem. The statement after it is the old answer. Unfortunately content projection into mat-form-field is not supported yet. Please track the following github issue to get the latest news about it. By now the only solution for you is either place your content directly into mat-form-field component or implement a MatFormFieldControl class … Read more

Angular – ng: command not found

I’m trying to learn Angular and my knowledge in terminal is beginner. After I installed Angular and then type ng new my-project. I get the response ng: command not found. I’ve seen other posts that had this problem and I’ve uninstalled and reinstalled npm and ng. The last step I took was npm install -g @angular/cli@latest then ng new my-project. … Read more

What is the difference between Promises and Observables?

Promise A Promise handles a single event when an async operation completes or fails. Note: There are Promise libraries out there that support cancellation, but ES6 Promise doesn’t so far. Observable An Observable is like a Stream (in many languages) and allows to pass zero or more events where the callback is called for each event. Often Observable is preferred over Promise because it provides the features of Promise and more. With Observable it doesn’t … Read more

(change) vs (ngModelChange) in angular

(change) event bound to classical input change event. You can use (change) event even if you don’t have a model at your input as (ngModelChange) is the @Output of ngModel directive. It fires when the model changes. You cannot use this event without ngModel directive. As you discover more in the source code, (ngModelChange) emits the new value. So it means … Read more

BehaviorSubject vs Observable?

BehaviorSubject is a type of subject, a subject is a special type of observable so you can subscribe to messages like any other observable. The unique features of BehaviorSubject are: It needs an initial value as it must always return a value on subscription even if it hasn’t received a next() Upon subscription, it returns the last … Read more

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