camptocamp/ngeo — pull request #103 by elemoine (2014-11-25 08:35:56+00:00)
Title: Better use of Closure and Angular

This PR implements some of the things described in the document http://google-styleguide.googlecode.com/svn/trunk/angularjs-google-style.html. The main changes are:

* One `goog.provide` per service instead of two. What is `goog.provide`'d is the type of the service. So if the service is a function what is `goog.provide`'d is what is the `@typedef` (e.g. `ngeo.Debounce`). If the service is an object what is `goog.provide`'d is the `constructor` (e.g. `ngeo.Location`).

* One `goog.provide` per directive. What's `goog.provide`'d in that case in the function returning the Directive Definition Object. This is as suggested in angularjs-google-style.html document.

* The namespaces using the snake notation (e.g. `ngeo_map_directive`) are completely gone.

* The use of `controller as` is generalized. The main controllers in the examples now all add the map to `this` instead of `$scope`.

* `@ngInject` and the `--angular_pass` compile flag are now used for the injection.

* Remove `ngeoDefaultMap`. It leads to bad practices because it's not compatible with `controller as`.

Closes #102.

Please review.