You are here

public function Ng2Block::attachLibraries in Decoupled Blocks 8

Attaches any libraries required by the component.

Parameters

array $component: The component definition.

Return value

array Array of attachments.

Overrides PdbBlock::attachLibraries

File

modules/pdb_ng2/src/Plugin/Block/Ng2Block.php, line 78

Class

Ng2Block
Exposes an Angular 2 component as a block.

Namespace

Drupal\pdb_ng2\Plugin\Block

Code

public function attachLibraries(array $component) {
  $parent_libraries = parent::attachLibraries($component);
  $framework_libraries = [
    'pdb_ng2/pdb.ng2.config',
  ];
  $libraries = [
    'library' => array_merge($parent_libraries, $framework_libraries),
  ];
  return $libraries;
}