"Fossies" - the Fresh Open Source Software Archive

Member "angular.js-1.8.2/README.closure.md" (21 Oct 2020, 927 Bytes) of package /linux/www/angular.js-1.8.2.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

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/