Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
Create hook_civicrm_alterAngular.md
Browse files Browse the repository at this point in the history
See civicrm/civicrm-core#10085
@totten I've added docs for this hook.
  • Loading branch information
colemanw committed Apr 22, 2018
1 parent e063f0f commit 8558fef
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/framework/angular/changeset.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
29 changes: 29 additions & 0 deletions docs/hooks/hook_civicrm_alterAngular.md
Original file line number Diff line number Diff line change
@@ -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\')');
})
);
}
```

0 comments on commit 8558fef

Please sign in to comment.