import all0 from "/src/fragments/ui/angular/configure-module.mdx";
Replace the content inside of *app.component.ts* with the following:
```js
import { Component, ChangeDetectorRef } from '@angular/core';
import { onAuthUIStateChange, CognitoUserInterface, AuthState } from '@aws-amplify/ui-components';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'amplify-angular-auth';
user: CognitoUserInterface | undefined;
authState: AuthState;
formFields: FormFieldTypes;
constructor(private ref: ChangeDetectorRef) {
this.formFields = [
{ type: "username" },
{ type: "password" },
{ type: "email" }
];
}
ngOnInit() {
onAuthUIStateChange((authState, authData) => {
this.authState = authState;
this.user = authData as CognitoUserInterface;
this.ref.detectChanges();
})
}
ngOnDestroy() {
return onAuthUIStateChange;
}
}
```
Replace the content inside of *app.component.html* with the following:
```html
```