import { Component } from '@angular/core';

import { FormGroup } from "@angular/forms";
import { MgFormControlsAccessor, MgControlName, MgCustomProperties } from "./Logout.mg.controls.g";


import { TaskBaseMagicComponent, magicProviders } from "@magic-xpa/angular";

import {
    MagicServices, // Add
} from '@magic-xpa/angular';
import {
    ChangeDetectorRef, // Add
    ViewContainerRef,
} from '@angular/core';

@Component({
    selector: 'mga-Logout',
    providers: [...magicProviders],
    templateUrl: './Logout.component.html'
})
export class Logout extends TaskBaseMagicComponent {

    mgc = MgControlName;
    mgcp = MgCustomProperties;
    mgfc!: MgFormControlsAccessor;
    override createFormControlsAccessor(formGroup: FormGroup) {
        this.mgfc = new MgFormControlsAccessor(formGroup, this.magicServices);
    }

    constructor(
        ref: ChangeDetectorRef,
        magicServices: MagicServices,
        protected vcRef: ViewContainerRef,
    ) {
        super(ref, magicServices);
    }


    Logout = () => {

        window.location.href="./";
    }

}