import { Component, OnInit, Input } from '@angular/core'; import { NotificationModel } from '../../../models/notification'; import { ButtonModel } from '../../../models/button/button.model'; import { ImageModel } from '../../../models/image/image.model'; import { ImageStylingModel } from '../../../models/image/image-styling.model'; @Component({ selector: 'cf-demo-image-1', template: "

{{ title0 }}

{{ title1 }}

{{ title2 }}

{{ title3 }}

{{ title4 }}

{{ title5 }}

", styles: ["/deep/ .image1 { width: 100%; height: 100px; border: 2px solid black; } /deep/ .label2 { color: coral; align-items: center; justify-content: center; background: purple; } /deep/ .image2 { width: 100%; height: auto; } /deep/ .image3 { width: auto; height: 300px; } "] }) export class CfDemoImage1 implements OnInit { title0 = 'Default Image Template'; defaultImage = new ImageModel (); title1 = 'Image without text and with style (border)'; myImage1 = new ImageModel ({ url: 'http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/beach-wallpaper-11.jpg' }); imageStyling1 = new ImageStylingModel ({ image: { class: "image1" } }); title2 = 'Image text on top'; myImage2 = new ImageModel ({ label: 'My image text', labelPosition: 'top', url: 'http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/beach-wallpaper-11.jpg', }); imageStyling2 = new ImageStylingModel ({ label: { class: "label2" }, image: { class: "image2" } }); title3 = 'Image text on right'; myImage3 = new ImageModel ({ label: 'My image text', labelPosition: 'right', url: 'http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/beach-wallpaper-11.jpg' }); imageStyling3 = new ImageStylingModel ({ label: { class: "label2" }, image: { class: "image3" } }); title4 = 'Image text on bottom'; myImage4 = new ImageModel ({ label:'My image text', labelPosition: 'bottom', url: 'http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/beach-wallpaper-11.jpg', }); title5 = 'Image text on left'; myImage5 = new ImageModel ({ label:'My image text', labelPosition: 'left', url: 'http://cdn.wonderfulengineering.com/wp-content/uploads/2016/01/beach-wallpaper-11.jpg', }); letters = 0; myNotifications: NotificationModel = { value: this.letters, classes: 'mat-accent', position: 'bottom-right' }; sender = new ButtonModel({ label: "Send mail", color: { foreground: "", background: "primary" } }); sendMessage() { ++this.myNotifications.value; } constructor() { } ngOnInit() { } }