Skip to content

Use import statement for TypeScript classes. #1

Open
@codeBelt

Description

@codeBelt

Love what you guys are going with Away3D and TypeScript. I just wanted to point out that you can use the import statement to clean up how TypeScript classes with namespaces are used.

You can use the import statement within the module like:

///<reference path="src/away/containers/View3D.ts" />

module examples
{
    import View3D = away.containers.View3D;

    export class AWDSuzanne
    {
        private _view:View3D;

        constructor()
        {
            this._view = new View3D();
        }
    }
}

I wrote a tutorial about it here:
http://www.codebelt.com/typescript/javascript-namespacing-with-typescript-internal-modules/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions