/**
 * Created by 10177553 on 2016/12/19.
 */

import {Component, OnInit, Input} from "@angular/core";
@Component({
  selector: 'md-card',
  template: `<div [ngClass]="setCardClass()" style="width: 500px;">
                   <div *ngIf="title" class="{{prefixCls}}-head">
                      {{title}}
                   </div>
                   <div class="{{prefixCls}}-body" [ngStyle]="bodyStyle">
                      <ng-content></ng-content>
                   </div>
              </div>`,
  styleUrls:['style/card.scss']
})

export class 
{
  @Input() title?:string;
  @Input() style?:Object;
  @Input() bordered?: boolean = true;
  @Input() bodyStyle?: Object;
  @Input() extra?:any;

  prefixCls: string = 'md-card';

  setCardClass(){
    let classes =  {
      'md-card': true,      // true
      'md-card-bordered': this.bordered, // false
    };
    return classes;
  }

}

MdCard