Angie
Extends:
This is the default Angie class. It is instantiated and given
the namespace global.app
. Static methods are available via this
instance.
It is ill advised to tray and redefine the native app as it is tightly coupled with the resource pipeline & webserver, instead, use the Angie class to access commonly used static methods.
Example:
Angie.noop() // = undefined
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
$$registry: * |
|
public |
|
|
public |
Controllers: * |
|
public |
configs: * |
|
public |
constants: * |
|
public |
directives: * |
|
public |
factories: * |
|
public |
services: * |
Method Summary
Public Methods | ||
public |
$$load(): * |
|
public |
$$register(component: *, name: *, obj: *): * |
|
public |
Controller(name: string, obj: function | object): object Creates an Angie Controller provider. |
since 0.0.1 |
public |
config(fn: *): * |
|
public |
Creates an Angie constant provider |
since 0.0.1 |
public |
controller(name: *, obj: *): * Alias of the Controller function. |
since 0.4.1 |
public |
Creates an Angie directive provider. |
since 0.2.3 |
public |
Creates an Angie service provider. |
since 0.3.1 |
public |
Creates an Angie service provider. |
since 0.0.1 |
public |
view(name: *, obj: *): * Alias of the directive function. |
since 0.4.1 |
Public Constructors
public constructor source
Public Members
public $$registry: * source
public $dependencies: * source
public Controllers: * source
public configs: * source
public constants: * source
public directives: * source
public factories: * source
public services: * source
Public Methods
public $$register(component: *, name: *, obj: *): * source
Params:
Name | Type | Attribute | Description |
component | * | ||
name | * | ||
obj | * |
Return:
* |
public Controller(name: string, obj: function | object): object since 0.0.1 source
Creates an Angie Controller provider. This must be a function that returns an object or an object.
Params:
Name | Type | Attribute | Description |
name | string | The name of the factory being created |
|
obj | function | object | The Controller value |
|
obj.template | string | An actual HTML template to be added as a byproduct of the Controller |
|
obj.templatePath | string | The path to an HTML template to be added as a byproduct of the Controller |
Example:
Angie.Controller('foo', () => {});
public constant(name: string, obj: object | string | number | Array<> | boolean): object since 0.0.1 source
Creates an Angie constant provider
Example:
Angie.constant('foo', 'bar');
public controller(name: *, obj: *): * since 0.4.1 source
Alias of the Controller function.
Params:
Name | Type | Attribute | Description |
name | * | ||
obj | * |
Return:
* |
Example:
Angie.Controller('foo', () => {});
public directive(name: string, obj: function | object): object since 0.2.3 source
Creates an Angie directive provider. The second parameter of the directive function must be an object, with properties defining the directive itself.
Params:
Name | Type | Attribute | Description |
name | string | The name of the constant being created |
|
obj | function | object | The directive value, returns directive params |
|
obj().Controller | string | The associated directive controller |
|
obj().priority | number | A number representing the directive's priority, relative to the other declared directives |
|
obj().restrict | string | What HTML components can parse this directive: 'A': attribute 'E': element 'C': class |
|
obj().link | function | A function to fire after the directive is parsed |
|
obj().template | string | An actual HTML template to be added as a byproduct of the directive |
|
obj().templatePath | string | The path to an HTML template to be added as a byproduct of the directive |
Example:
Angie.directive('foo', {
return {
Controller: 'test',
link: function() {}
};
});
public factory(name: string, fn: function): object since 0.3.1 source
Creates an Angie service provider. This must be a function.
Example:
Angie.factory('foo', () => undefined);
public service(name: string, obj: object): object since 0.0.1 source
Creates an Angie service provider. This must be an object.
Example:
Angie.service('foo', {});
public view(name: *, obj: *): * since 0.4.1 source
Alias of the directive function.
Params:
Name | Type | Attribute | Description |
name | * | ||
obj | * |
Return:
* |
Example:
Angie.directive('foo', {
return {
Controller: 'test',
link: function() {}
};
});