Skip to content
Snippets Groups Projects
Commit 83befbb5 authored by Sean Madsen's avatar Sean Madsen
Browse files

Improve markdown formatting

parent e8e0ff85
No related branches found
No related tags found
No related merge requests found
...@@ -11,45 +11,51 @@ available in CiviCRM 4.6+. ...@@ -11,45 +11,51 @@ available in CiviCRM 4.6+.
## Definition ## Definition
angularModules(&$angularModules) ```php
angularModules(&$angularModules)
```
## Parameters ## Parameters
* `&$angularModules` - an array containing a list of all Angular modules. Each item is keyed by the Angular module name. * `&$angularModules` - an array containing a list of all Angular modules. The key for each item is the name of the module. The value for each item is an array with the following key/value pairs:
Each item `angularModules` may include these properties: * `'ext' =>`*`(string)`* - The name of the CiviCRM extension which has the source-code.
* `'js' =>`*`(array)`* - List of Javascript files. May use the wildcard (`*`). Relative to the extension.
* `ext` (`string`): The name of the CiviCRM extension which has the source-code. * `'css' =>`*`(array)`* - List of CSS files. May use the wildcard (`*`). Relative to the extension.
* `js` (`array`): List of Javascript files. May use the wildcard (`*`). Relative to the extension. * `'partials' =>`*`(array)`* - List of HTML folders. Relative to the extension.
* `css` (`array`): List of CSS files. May use the wildcard (`*`). Relative to the extension. * `'settings' =>`*`(array)`* - Runtime data to export from PHP to JS.
* `partials` (`array`): List of HTML folders. Relative to the extension. * This is mapped to the JS global (Ex: `array("foo"=>"bar")`, which would be available as `CRM.myModule.foo`.
* `settings` (`array`): Runtime data to export from PHP to JS. This is mapped to the JS global (Ex: `array("foo"=>"bar")`, which would be available as `CRM.myModule.foo`. * `'requires' =>`*`(array)`* - List of AngularJS modules required by this module.
* `requires` (`array`): List of AngularJS modules required by this module. Default: `array()`. (`v4.7.21+`) * Default: `array()`.
* `basePages` (`array`): Uncondtionally load this module onto the given Angular pages. (`v4.7.21+`) * CiviCRM 4.7.21+
* If omitted, the default is `array('civicrm/a')`. This provides backward compatibility with behavior since `v4.6+`. * `'basePages' =>`*`(array)`* - Unconditionally load this module onto the given Angular pages.
* For a utility that should only be loaded on-demand, use `array()`. * If omitted, the default is `array('civicrm/a')`. This provides backward compatibility with behavior since `v4.6+`.
* For a utility that should be loaded in all pages use, `array('*')`. * For a utility that should only be loaded on-demand, use `array()`.
* For a utility that should be loaded in all pages use, `array('*')`.
* CiviCRM 4.7.21+
## Returns ## Returns
* `null` * `null`
## Example ## Example
function mymod_civicrm_angularModules(&$angularModules) { ```php
$angularModules['myAngularModule'] = array( function mymod_civicrm_angularModules(&$angularModules) {
'ext' => 'org.example.mymod', $angularModules['myAngularModule'] = array(
'js' => array('js/myAngularModule.js'), 'ext' => 'org.example.mymod',
); 'js' => array('js/myAngularModule.js'),
$angularModules['myBigAngularModule'] = array( );
'ext' => 'org.example.mymod', $angularModules['myBigAngularModule'] = array(
'requires' => array('ngRoute', 'crmUi'), 'ext' => 'org.example.mymod',
'basePages' => array('civicrm/a'), 'requires' => array('ngRoute', 'crmUi'),
'js' => array('js/part1.js', 'js/part2.js'), 'basePages' => array('civicrm/a'),
'css' => array('css/myAngularModule.css'), 'js' => array('js/part1.js', 'js/part2.js'),
'partials' => array('partials/myBigAngularModule'), 'css' => array('css/myAngularModule.css'),
'settings' => array( 'partials' => array('partials/myBigAngularModule'),
'foo' => 'bar', 'settings' => array(
), 'foo' => 'bar',
); ),
} );
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment