Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ccec13

Browse files
committed
feat(Angular.js): add externs file for Closure Compiler
This adds an (incomplete) externs file for use with the Closure Compiler. Users can pass this as -extern to the compiler pass to get type checking and protect their AngularJS use against property renaming in advanced compilation mode.
1 parent 43d4901 commit 3ccec13

File tree

2 files changed

+1733
-0
lines changed

2 files changed

+1733
-0
lines changed

closure/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This file contains externs for use with the Closure compiler (aka JSCompiler).
2+
Passing these files to the --externs parameter of a compiler pass allows using
3+
type annotations for AngularJS objects. For example, Angular's $scope objects
4+
can be annotated as:
5+
/** @type {angular.Scope} */ var scope = $scope;
6+
7+
This allows JSCompiler to type check accesses to scope, give warnings about
8+
missing methods or incorrect arguments, and also prevents renaming of property
9+
accesses with advanced compilation.
10+
11+
The externs are incomplete and maintained on an as-needed basis, but strive to
12+
be correct. Externs for individual modules should be added in separate files.
13+
14+
See https://developers.google.com/closure/compiler/

0 commit comments

Comments
 (0)