0

I am using angulat 1.5 with typescript. i have all the necessary configurations in tsconfig.json when 9 run tslint, there are lot of errors in project : which says

Cannot find namespace angular

ts config.json looks like

{
"compilerOptions": {
    "target": "es5"
    "module": "amd",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "sourceMap": true
},
"exclude": [
    "node_modules",

]

}

tsd.d.ts file in typings folder contains :

 /// <reference path="angular-ui-router/angular-ui-router.d.ts" />
/// <reference path="angularjs/angular-animate.d.ts" />
/// <reference path="angularjs/angular-cookies.d.ts" />
/// <reference path="angularjs/angular-mocks.d.ts" />
/// <reference path="angularjs/angular-resource.d.ts" />
/// <reference path="angularjs/angular-sanitize.d.ts" />
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="jquery/jquery.d.ts" />
/// <reference path="moment/moment-node.d.ts" />
/// <reference path="moment/moment.d.ts" />

does anyone have the solution to fix that.

2
  • Please add your project config. Commented Aug 25, 2016 at 6:48
  • added tsd.d.ts and tsconfig.ts also i referred tsd.d.ts in app.ts(application main module where it b ootstraps.) Commented Aug 25, 2016 at 6:58

1 Answer 1

1

Try moving /// <reference path="angularjs/angular.d.ts" /> at the top, my guess is that the other reference may try to extend the angular namespace, which is not yet defined.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.