I am learning AngularJS and have read that it supports three different ways to specify dependencies.

Their docs say that inline array notation "is the preferred way to annotate application components". Further, they "recommend avoiding" implicit annotation because it cannot safely pass through a JavaScript minifier. Ok.

But most of the AngularJS code in CiviCRM appears to be using implicit annotation (example).

Thus, I am wondering:

  • Was "implicit annotation" a conscious design choice for some reason? (e.g. Maybe CiviCRM has some 3rd-party tool like ng-annotate in place to add inline array notation before minification?)
  • Or perhaps: is the implicit syntax I'm seeing just incidental? In which case I would guess that I should avoid replicating this syntax when writing new code (for the sake of compatibility with potential future minification strategies).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.