Home Identifier Source Repository
import {Angie} from 'angie/src/Angie.js'
public class | since 0.0.1 | source

Angie

Extends:

*$Util → Angie

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
public
public
public

configs: *

public
public
public
public

Method Summary

Public Methods
public

$$load(): *

public

$$register(component: *, name: *, obj: *): *

public

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

factory(name: string, fn: function): object

Creates an Angie service provider.

since 0.3.1
public

service(name: string, obj: object): object

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 $$load(): * source

Return:

*

public $$register(component: *, name: *, obj: *): * source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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

Return:

object

this instanceof Angie

Example:

Angie.Controller('foo', () => {});

public config(fn: *): * source

Params:

NameTypeAttributeDescription
fn *

Return:

*

public constant(name: string, obj: object | string | number | Array<> | boolean): object since 0.0.1 source

Creates an Angie constant provider

Params:

NameTypeAttributeDescription
name string

The name of the constant being created

obj object | string | number | Array<> | boolean

The object value

Return:

object

this instanceof Angie

Example:

Angie.constant('foo', 'bar');

public controller(name: *, obj: *): * since 0.4.1 source

Alias of the Controller function.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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

Return:

object

this instanceof Angie

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.

Params:

NameTypeAttributeDescription
name string

The name of the factory being created

fn function

The function value

Return:

object

this instanceof Angie

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.

Params:

NameTypeAttributeDescription
name string

The name of the service being created

obj object

The object value

Return:

object

this instanceof Angie

Example:

Angie.service('foo', {});

public view(name: *, obj: *): * since 0.4.1 source

Alias of the directive function.

Params:

NameTypeAttributeDescription
name *
obj *

Return:

*

Example:

Angie.directive('foo', {
    return {
        Controller: 'test',
        link: function() {}
    };
});