File

src/components/kendoUI/kendocomponent/kendocomponent.component.ts

Implements

OnDestroy DoCheck AfterViewInit

Index

Properties
Methods
Accessors

Constructor

constructor(differs: KeyValueDiffers, elementRef: ElementRef, widgetName: string)
Parameters :
Name Type Optional
differs KeyValueDiffers No
elementRef ElementRef No
widgetName string No

Properties

boundValue
Type : any
Private differences
Type : any
element
Type : any

Component properties element: Has the native element reference. kWidget: k-widget reference. widget: Widget reference. boundValue: It controls the bound value for the current component. modelValue: It controls the model value for the current component. prefix: Is used to set a prefix for a function of the current component. isViewInitialized: Boolean view value for the current component. eventQueue: This property contains an array of all the events registered to this component. differences: Is used to check if the model changes.

eventQueue
Type : any[]
Default value : []
isViewInitialized
Default value : false
kWidget
Type : any
modelValue
Type : any
prefix
Type : string
Default value : 'applyRefresh'
widget
Type : any

Methods

Protected applyChanges
applyChanges(changes: any)

This method apply changes when any of the following actions in the model is triggered: forEachRemovedItem: Something has been removed. forEachAddedItem: Something has been added. forEachChangedItem: Something has been changed.

Parameters :
Name Type Optional Description
changes any No

Value with any change in the model

Returns : void
ngAfterViewInit
ngAfterViewInit()

This is part of Angular lifecycle hook. By definition this is Called once after the first ngAfterContentChecked(). Our ngAfterViewInit is the one incharge to process the eventQueue array whe the view is initialized.

Returns : void
ngDoCheck
ngDoCheck()

This is part of Angular lifecycle hook. By definition this is the one who detect and act upon changes that Angular can not or will not detect on its own. ngDoCheck notifies when model changes and send to applyChanges() method the changes.

Returns : void
ngOnDestroy
ngOnDestroy()

This is part of Angular lifecycle hook. By definition this is the one who destroys a component. ngOnDestroy gets the native element reference and destroy its widget.

Returns : void
registerFunction
registerFunction(property: string, fn: (val: any) => void)

This function is a merge between a component property and a function, you have to use registerFunction when you need to execute a function after some property change this string must has the first letter as a capital letter in order to follow the model's properties structure.

Parameters :
Name Type Optional Description
property string No

Contains the name of the property that you want to register, this string must has the first letter as a capital letter in order to follow the model's properties structure.

fn function No

contains the function required to call.

Returns : void
render
render()

Render method is the one in charge to set a refecence of k-widget and widget.

Returns : void
Protected updateComponent
updateComponent(key: string, value: any)

This function builds a registered function and push it to eventQueue array.

Parameters :
Name Type Optional Description
key string No

KeyValue corresponding to a property Name.

value any No

CurrentValue of a function.

Returns : void

Accessors

bound
getbound()

Return boundValue.

Returns : any
setbound(value: any)
Parameters :
Name Type Optional Description
value any No

Cotains a new boundValue.

Returns : void
model
setmodel(value: any)

This sets a new model if the model changes

Parameters :
Name Type Optional Description
value any No

Value contains a new modelValue

Returns : void

results matching ""

    No results matching ""