You are here

function angularjs_init_application in AngularJS 7

Initializes an AngularJS application setting the application name, the base path and adds the library

Parameters

string $name: The application name

string $base_href: The base href, defaults to current page if nothing is entered

2 calls to angularjs_init_application()
angularjs_examples_nodes in modules/angularjs_examples/angularjs_examples.module
Page callback for node example.
angularjs_map_map in modules/angularjs_map/angularjs_map.module

File

./angularjs.module, line 224

Code

function angularjs_init_application($name, $base_href = NULL) {

  // If no value is entered use the current URL
  if (NULL == $base_href) {
    $base_href = url($_GET['q']) . '/';
  }
  angularjs_set_app_name($name);
  angularjs_set_base_href($base_href);
  drupal_add_library('angularjs', 'angularjs');
}