Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ImageCoverComponent

whatitdoes

Creates an image that covers the element.

consumers

HomeModule

Features:

  • Covers the entire element using background-size: cover
  • Creates an img that can be right clicked and saved
  • img can have alt text

The img element is not visible to the user. Instead the user sees the background-image optimized with the cover style.

Hierarchy

  • ImageCoverComponent

Implements

  • AfterViewInit
  • OnChanges
  • OnInit

Index

Constructors

constructor

Properties

alt

alt: string

Optional string to use for the alt attribute of the img element.

Private element

element: ElementRef

a reference to the host element

fadeIn

fadeIn: boolean = false

Image will fade into view when true.

imgError

imgError: boolean = false

True after there is an error loading the img element.

imgLoad

imgLoad: boolean = false

True after img element has loaded.

Private renderer

renderer: Renderer

used to update the DOM Angular 2 - Renderer

src

src: string

Image url to use for the img element and host element's background-image style.

Methods

ngAfterViewInit

  • ngAfterViewInit(): void

ngOnChanges

  • ngOnChanges(): void

ngOnInit

  • ngOnInit(): void

Private updateImage

  • updateImage(): void

Generated using TypeDoc