Home Reference Source
public class | source

AbstractBlock

Extends:

AbstractService → AbstractBlock

Direct Subclass:

AbstractInViewBlock

Base class for creating block implementations.

Do not instanciate this class directly, create a sub-class.

Constructor Summary

Public Constructor
public

constructor(container: Object, blockName: String)

Abstract block constructor.

Member Summary

Public Members
public

Block id

public

Node name

public

Current page instance

public

rootElement: HTMLElement | null

Container Root container HTMLElement for current block.

public

Node Type block name type

Method Summary

Public Methods
public

Destroy current block.

public abstract

Unbind event block events.

public abstract

init()

Basic members initialization for children classes.

public abstract

Bind load and resize events for this specific block.

public abstract

Called once all page blocks have been created.

public abstract

Called on window resize

Inherited Summary

From class AbstractService
public
public
public

checkDependencies(dependencies: *[])

public

getService(serviceName: *): *

public

hasService(serviceName: *): *

public

init()

Public Constructors

public constructor(container: Object, blockName: String) source

Abstract block constructor.

It‘s better to extend this class by using init method instead of extending constructor.

Override:

AbstractService#constructor

Params:

NameTypeAttributeDescription
container Object
blockName String

Public Members

public id: String | null source

Block id

public name: String source

Node name

public page: AbstractPage | null source

Current page instance

public rootElement: HTMLElement | null source

Container Root container HTMLElement for current block.

public type: String | null source

Node Type block name type

Public Methods

public destroy() source

Destroy current block.

Do not forget to call super.destroy(); while extending this method.

public abstract destroyEvents() source

Unbind event block events.

Make sure you’ve used binded methods to be able to off them correctly.

Do not forget to call super.destroyEvents(); while extending this method.

public abstract init() source

Basic members initialization for children classes. Do not search for page blocks here, use onPageReady method instead

Override:

AbstractService#init

public abstract initEvents() source

Bind load and resize events for this specific block.

Do not forget to call super.initEvents(); while extending this method.

public abstract onPageReady() source

Called once all page blocks have been created.

public abstract onResize() source

Called on window resize