PHP code example of domatskiy / bitrix-angular

1. Go to this page and download the library: Download domatskiy/bitrix-angular library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

domatskiy / bitrix-angular example snippets


if(class_exists('\Domatskiy\Angular'))
{
    $EventManager->addEventHandler("main", "OnEpilog", "OnEpilogHandler", true, 2);

    function OnEpilogHandler()
    {
        $angular = \Domatskiy\Angular::getInstance();
        //$angular->setVendorJs(SITE_TEMPLATE_PATH."/js/angular.min.js"); // add in header vendor js
        $angular->setAppJs(SITE_TEMPLATE_PATH."/assets/app/app.min.js");
        $angular->addModule('<module_name>', '<module_path>');
        $angular->init();

    }

}

if(class_exists('\Domatskiy\Angular'))
{
	$angular = \Domatskiy\Angular::getInstance();
	$angular->setAppJs(<path_template_js>);
	$angular->addModule('<module_name>', '<module_path>');
}