1.0.4 • Published 4 years ago

exc-core v1.0.4

Weekly downloads
53
License
-
Repository
-
Last release
4 years ago

Documentation

Module Exc-Core

ExcCoreModule implements some static core features for the app and the communication between components, directives, services etc.

Members

Array

Methods
MethodReturnDescription
Get(array,value)anyGets the first entry from array matches to value
GetIndex(array,value)numberGets the index of the first entry from array matches to value
GetObject(array, key, value)anyGets the first entry from array of objects where the objectkey matches to value
GetObjectIndex(array, key, value)numberGets the index of the first entry from array of objects where the objectkey matches to value
GetAll(array, key, value)any[]Gets all entries from array of objects where the objectkey matches to value
Remove(array, value)any[]Removes the first element from the array matches to the value. Returns remaining array items
RemoveObject(array, key, value)any[]Removes the first element from the array matches to the value. Returns remaining array items
RemoveAll(array, value)any[]Removes all elements from the array matches to the value. Returns remaining array items
RemoveObjectAll(array, key, value)any[]Removes all elements from the array matches to the value. Returns remaining array items
Add(array, value)any[]Adds an element to the array. Returns result array
Merge(array1, array2)any[]Adds all elementes of array2 to array1. Returns merged array
Exists(array, value)booleanSearch an array for an element matches to the value. Returns true or false
ExistsObject(array, key, value)booleanSearch an array for an element where the objectkey matches to the value. Returns true or false
Distinct(array)any[]Removes duplicated items in array.
ExistsObject(array, key)any[]Removes duplicated items in array where the objectkey matches.

Guid

Methods
MethodReturnDescription
NewGuid()stringGenerates a new uniqueidentifier (Guid)

Object

Methods
MethodReturnDescription
Replace(destination,source)voidReplaces all values in destination object from source object.Keeps values in destination if they doesn't exist in sourceIgnores values from source if they doesn't exist in destination
Merge(destination,...source)voidMerges values from all source objects to destination object
DeepMerge(destination,...source)voidMerges (recursive) values from all source objects to destination object

String

Methods
MethodReturnDescription
Format(text,...args)stringFormats a string and injects the arguments by indexExampleExcCoreModule.String.Format("This {0} is crazy for {1}!","world","Robin") returns "This world is crazy for Robin!"
Reverse(text)stringReverses a given string

Methods

MethodReturnDescription
on(name,callback)functionRegisters a callback function to a specified name as an event
call(name,...args)functionCalls all callback functions for the specified name and tunnels all arguments to callback functions.
showInfo(message,title?)voidCalls "eAM.ShowInfo" event. Listening to this event with ExcCoreModule.on("eAM.ShowInfo",function(message,title){//Your code here});
showSuccess(message,title?)voidCalls "eAM.ShowSuccess" event. Listening to this event with ExcCoreModule.on("eAM.ShowSuccess",function(message,title){//Your code here});
showWarning(message,title?)voidCalls "eAM.ShowWarning" event. Listening to this event with ExcCoreModule.on("eAM.ShowWarning",function(message,title){//Your code here});
showError(message,title?)voidCalls "eAM.ShowError" event. Listening to this event with ExcCoreModule.on("eAM.ShowError []() ",function(message,title){//Your code here});
showModal(content,header?,size?,data?,closeViaOverlay?,footerButtons?)ObservableOpen a modal window as configured. Place content as string or place a component name
RegisterService(key,value)voidRegisters a value to ExcCoreModule.Services().
RegisterConfig(key,value)voidRegisters a value to ExcCoreModule.Config().
Services()anyGets all values registered by RegisterService(key,value)
Config()anyGets all values registered by RegisterConfig(key,value)

Module Exc-Translation

Exc-Translation is a class for translation of text resources. All other classes using translation have to extend this class

Usage: export class ClassName extends ExcTranslation

After this you have the option to use translations in ClassName

Methods

MethodReturnDescription
getCurrentLang()stringGet current selected language as string
onLangChangeObservableDefine a callback function which is called at language change
getRessource(name,param?)stringGet a text resource of the current ClassName and the selected language. You can use placeholders in translation file to pass params to specific positions
getGlobal(name,param?)stringGet a global text resource and the selected language. You can use placeholders in translation file to pass params to specific positions
getTranslation(name,param?)stringGet text resource from root position and the selected language. You can use placeholders in translation file to pass params to specific positions
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago