﻿abstract class ModelView extends TemplateView
{
    // Attributes
    private _model: Model;

    // Constructor
    constructor(parentEl: any, model: BasicModel, options?: BasicTemplateViewOptions)
    {
        super(parentEl, options);
        this._model = model;
    }

    // Properties
    get Model(): Model
    {
        return this._model;
    }

    // Methods
    protected RenderView(el: JQuery): void
    {
        if (this.HasTemplate())
        {         
            // Render the model in the view
            // using the template
            el.html(this._model.ToHtml(this.Template));
        }
        else
        {
            el.html("Error no template provided");
        }
    }
} 