diff --git a/docs/framework/angular/changeset.md b/docs/framework/angular/changeset.md index 8f84ba38..a067e4b3 100644 --- a/docs/framework/angular/changeset.md +++ b/docs/framework/angular/changeset.md @@ -19,7 +19,11 @@ independent deployments with independent configurations). ... -## tldr +## Hooks + +* **[hook_civicrm_alterAngular](/hooks/hook_civicrm_alterAngular.md)** - Alter the definition of some Angular HTML partials. + +## Example ```php function mailwords_civicrm_alterAngular(\Civi\Angular\Manager $angular) { diff --git a/docs/hooks/hook_civicrm_alterAngular.md b/docs/hooks/hook_civicrm_alterAngular.md new file mode 100644 index 00000000..d588f8dc --- /dev/null +++ b/docs/hooks/hook_civicrm_alterAngular.md @@ -0,0 +1,29 @@ +# hook_civicrm_alterAngular + +## Summary + +Alter the definition of some Angular HTML partials; allows the injection of [Changesets](/framework/angular/changeset/). + +## Availability + +This hook is available in CiviCRM 4.7.21 and later. + +## Definition + + hook_civicrm_alterAngular(&$angular) + +## Parameters + +- array `$angular` - `\Civi\Angular\Manager` + +## Example + +```php +function example_civicrm_alterAngular($angular) { + $angular->add(\Civi\Angular\ChangeSet::create('mychanges') + ->alterHtml('~/crmMailing/EditMailingCtrl/2step.html', function(phpQueryObject $doc) { + $doc->find('[ng-form="crmMailingSubform"]')->attr('cat-stevens', 'ts(\'wild world\')'); + }) + ); +} +```