I created a new project using the gulp-angular Yeoman generator with language set to TypeScript. Then ran the Gulp build process and also opened the page in a web browser, w
Cannot find namespace 'ng'"
Make sure the project contains no reference to declare module ng. Same for moment.
based on edit in the question:
Explicitely referencing the type definition files by adding the following to the top of navbar.directive.ts removes the problem
Please use a tsconfig.json : https://basarat.gitbooks.io/typescript/content/docs/project/compilation-context.html