Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
23 lines (18 loc) · 927 Bytes

File metadata and controls

23 lines (18 loc) · 927 Bytes
Copy raw file
Download raw file
Edit and raw actions

Using AngularJS with the Closure Compiler

The Closure Compiler project contains definitions for the AngularJS JavaScript in its contrib/externs directory.

The definitions contain externs for use with the Closure compiler (aka JSCompiler). Passing these files to the --externs parameter of a compiler pass allows using type annotations for AngularJS objects. For example, AngularJS's $scope objects can be annotated as:

/** @type {angular.Scope} */
var scope = $scope;

This allows JSCompiler to type check accesses to scope, give warnings about missing methods or incorrect arguments, and also prevents renaming of property accesses with advanced compilation.

The externs are incomplete and maintained on an as-needed basis, but strive to be correct. Externs for individual modules should be added in separate files.

See https://developers.google.com/closure/compiler/

Morty Proxy This is a proxified and sanitized view of the page, visit original site.