aboutsummaryrefslogtreecommitdiffstats
path: root/closure/README.md
diff options
context:
space:
mode:
authorMartin Probst2013-10-30 14:56:55 -0700
committerMartin Probst2013-10-30 14:59:33 -0700
commit3ccec13aa702d9a7f75316df0c70873d72148b24 (patch)
tree23b28e4ec8433af80272c03767961a2074662e32 /closure/README.md
parent43d49013d103b3e64aeb2b40fa69b182a8128f6d (diff)
downloadangular.js-g3_v1_0.tar.bz2
feat(Angular.js): add externs file for Closure Compilerg3_v1_0
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.
Diffstat (limited to 'closure/README.md')
-rw-r--r--closure/README.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/closure/README.md b/closure/README.md
new file mode 100644
index 00000000..23f9d401
--- /dev/null
+++ b/closure/README.md
@@ -0,0 +1,14 @@
+This file contains 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, Angular'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/