Function
Static Public Summary | ||
public |
Inject(token: *): ParameterDecorator Marks a param to be injected with the registered provider registered with the token. |
|
public |
Injectable(config: InjectableConfigArgs): ClassDecorator Marks a dependency as injectable. |
|
public |
Lazy(): ParameterDecorator Marks a dependency as lazy. |
|
public |
MemoizeFrom(properties: ...string[]): MethodDecorator A decorator that memoizes a functions computation based on the current and previous value of other parameters. |
|
public |
ObserveViewHook(hook: string): PropertyDecorator Creates an Observable that emits when the provided hook is invoked. |
|
public |
Optional(): ParameterDecorator Marks a dependency as optional. |
|
public |
Self(): ParameterDecorator Will only check the injector creating the dependency. |
|
public |
ViewComponent(config: ViewComponentConfigArgs): ClassDecorator Registers view metadata with a component class. |
|
public |
ViewInsert(config: ViewInsertConfigArgs): PropertyDecorator Sets up a view insert method. |
|
public |
ViewLinkInit(injections: ...any[]): MethodDecorator Sets up an init method that is invoked at the time a view is linked by the ViewLinker. |
|
public |
ViewQuery(config: ViewQueryConfigArgs): MethodDecorator Sets up a view query with the decorated method as the callback to receive the query results. |
|
public |
ViewResolve(config: ViewResolveConfigArgs): PropertyDecorator Sets up a view resolve method. |
|
public |
clamp(val: *, min: *, max: *): * |
|
public |
defaults(dest: *, src: *): * |
|
public |
eq(value: *): * |
|
public |
forwardRef(fn: Function): ForwardRef A factory that creates a ForwardRef. |
|
public |
get(obj: *, path: *, defaultValue: *, comparer: *): * |
|
public |
getDefaultMetadata(): {"queries": *, "inits": *, "inserts": *, "resolves": *} |
|
public |
isBoolean(val: *): * |
|
public |
isFunction(val: *): * |
|
public |
isNumber(val: *): * |
|
public |
isObject(val: *): * |
|
public |
isObserver(val: *): * |
|
public |
isPromise(value: *): * |
|
public |
isString(val: *): * |
|
public |
isUndefined(val: *): * |
|
public |
negate(fn: *): * |
|
public |
|
|
public |
propEq(prop: *, value: *): * |
|
public |
|
Static Public
public Inject(token: *): ParameterDecorator source
import {Inject} from 'ug-layout/di/decorators'
Marks a param to be injected with the registered provider registered with the token.
Params:
Name | Type | Attribute | Description |
token | * |
Return:
ParameterDecorator |
public Injectable(config: InjectableConfigArgs): ClassDecorator source
import {Injectable} from 'ug-layout/di/decorators'
Marks a dependency as injectable. When the dependency is created using
Injector.fromInjectable
the dependency can define some scoped dependencies.
Params:
Name | Type | Attribute | Description |
config | InjectableConfigArgs |
|
Return:
ClassDecorator |
Example:
@Injectabled({
providers: [
{ provide: MyToken, useValue: 'blorg' }
]
})
class MyClass {
constructor(
@Inject(MyToken) private myBlorg: string
) {
console.log(myBlorg); // => 'blorg
}
}
Injector.fromInjectable(MyClass).get(MyToken) // => 'blorg';
public Lazy(): ParameterDecorator source
import {Lazy} from 'ug-layout/di/decorators'
Marks a dependency as lazy. Injects a function that will resolve the dependency.
Return:
ParameterDecorator |
Example:
class MyClass {
constructor(
@Inject(MyToken) @Lazy() private getMyService: () => MyService
) {
console.log(getMyService()); // => myService
}
}
public MemoizeFrom(properties: ...string[]): MethodDecorator source
import {MemoizeFrom} from 'ug-layout/dom/decorators'
A decorator that memoizes a functions computation based on the current and previous value of other parameters.
Params:
Name | Type | Attribute | Description |
properties | ...string[] |
Return:
MethodDecorator |
public ObserveViewHook(hook: string): PropertyDecorator source
import {ObserveViewHook} from 'ug-layout/view/hooks/decorators'
Creates an Observable that emits when the provided hook is invoked. The value emitted is the argument given to the hook. The hook completes when the view container is destroyed.
Params:
Name | Type | Attribute | Description |
hook | string | The name of the hook. If an invalid hook name is given no value is emitted. |
Return:
PropertyDecorator |
public Optional(): ParameterDecorator source
import {Optional} from 'ug-layout/di/decorators'
Marks a dependency as optional. Returns null if not found.
Return:
ParameterDecorator |
public Self(): ParameterDecorator source
import {Self} from 'ug-layout/di/decorators'
Will only check the injector creating the dependency. It will not check any parents.
Return:
ParameterDecorator |
public ViewComponent(config: ViewComponentConfigArgs): ClassDecorator source
import {ViewComponent} from 'ug-layout/view/decorators'
Registers view metadata with a component class.
Params:
Name | Type | Attribute | Description |
config | ViewComponentConfigArgs |
|
Return:
ClassDecorator |
public ViewInsert(config: ViewInsertConfigArgs): PropertyDecorator source
import {ViewInsert} from 'ug-layout/view/decorators'
Sets up a view insert method.
Params:
Name | Type | Attribute | Description |
config | ViewInsertConfigArgs |
Return:
PropertyDecorator |
public ViewLinkInit(injections: ...any[]): MethodDecorator source
import {ViewLinkInit} from 'ug-layout/view/decorators'
Sets up an init method that is invoked at the time a view is linked by the ViewLinker. Any dependencies need from the Layouts DI can be injected.
Params:
Name | Type | Attribute | Description |
injections | ...any[] | Injection tokens for services needing to be injected into the controller. |
Return:
MethodDecorator |
public ViewQuery(config: ViewQueryConfigArgs): MethodDecorator source
import {ViewQuery} from 'ug-layout/view/decorators'
Sets up a view query with the decorated method as the callback to receive the query results.
Params:
Name | Type | Attribute | Description |
config | ViewQueryConfigArgs |
|
Return:
MethodDecorator |
public ViewResolve(config: ViewResolveConfigArgs): PropertyDecorator source
import {ViewResolve} from 'ug-layout/view/decorators'
Sets up a view resolve method.
Params:
Name | Type | Attribute | Description |
config | ViewResolveConfigArgs |
Return:
PropertyDecorator |
public clamp(val: *, min: *, max: *): * source
import {clamp} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * | ||
min | * | ||
max | * |
Return:
* |
public defaults(dest: *, src: *): * source
import {defaults} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
dest | * | ||
src | * |
Return:
* |
public eq(value: *): * source
import {eq} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
value | * |
Return:
* |
public forwardRef(fn: Function): ForwardRef source
import {forwardRef} from 'ug-layout/di/Injector'
A factory that creates a ForwardRef.
Params:
Name | Type | Attribute | Description |
fn | Function |
Example:
const test = forwardRef(() => 'test');
test.ref; // => 'test'
public get(obj: *, path: *, defaultValue: *, comparer: *): * source
import {get} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
obj | * | ||
path | * | ||
defaultValue | * | ||
comparer | * |
|
Return:
* |
public getDefaultMetadata(): {"queries": *, "inits": *, "inserts": *, "resolves": *} source
import {getDefaultMetadata} from 'ug-layout/view/decorators'
Return:
{"queries": *, "inits": *, "inserts": *, "resolves": *} |
public isBoolean(val: *): * source
import {isBoolean} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isFunction(val: *): * source
import {isFunction} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isNumber(val: *): * source
import {isNumber} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isObject(val: *): * source
import {isObject} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isObserver(val: *): * source
import {isObserver} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isPromise(value: *): * source
import {isPromise} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
value | * |
Return:
* |
public isString(val: *): * source
import {isString} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public isUndefined(val: *): * source
import {isUndefined} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * |
Return:
* |
public negate(fn: *): * source
import {negate} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
fn | * |
Return:
* |
public partition(list: *, predicate: *): undefined[] source
import {partition} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
list | * | ||
predicate | * |
public propEq(prop: *, value: *): * source
import {propEq} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
prop | * | ||
value | * |
Return:
* |
public round(val: *, precision: number): * source
import {round} from 'ug-layout/utils/index'
Params:
Name | Type | Attribute | Description |
val | * | ||
precision | number |
|
Return:
* |