Ciel
Ciel

Reputation: 4440

Difficulty with AngularJS "module" declaration in Typescript in Visual Studio 2013

I am attempting to use Typescript to build an Angular JS 1.3 app, and I am having trouble right out the gate because it says that "module" does not exist on"typeof angular".

I thought this was easily rectified by just including the "DefinitelyTyped" angular.d.ts file, but that doesn't seem to have done anything.

My folder structure looks like this...

And my angular app.core.ts looks like this;

/// <reference path="~/application/assets/typings/jquery/jquery.d.ts" />
/// <reference path="~/application/assets/typings/angularjs/angular.d.ts" />

    ((): void => {
        'use strict';

        angular
            .module('app', [
            /*
             * Angular Modules
             */
                'kendo.directives',
                'ui.bootstrap',
                'ui.bootstrap.drawer',
                'ui.check'
            ]);
    })();

At first I just assumed the paths were wrong, but it doesn't seem to matter what paths I use. If I use paths relative to the app.core.ts file, it still doesn't work.

I am using Visual Studio 2013.4 Professional, and it looks like this on my screen;

angular error

Can anyone help me? I'm getting very frustrated already with angular.

Upvotes: 4

Views: 526

Answers (1)

thomaux
thomaux

Reputation: 19718

The latest definition files use TypeScript 1.4 syntax. Please verify your IDE supports this version.

Upvotes: 6

Related Questions