Add JavaScript inside controller How to add JavaScript inside controller? I don't want to call build form. I can call css or js in src/Form/Form.php but I want to call css or js inside Controller src/Controller/Controller.php
This process I am using to call css and js in Form page 

public function buildForm(array $form, FormStateInterface $form_state,$cid = NULL)
{

$form['#attached']['library'][] = 'cssjs/val_master';

}


Could anyone write some example to call css or js inside Controller

Thanks.
The same you can use in Controller also:

&lt;?php

   namespace Drupal\cssjs\Controller;

   use Drupal\Core\Controller\ControllerBase;

   class CssJs extends ControllerBase{
     public function css_js(){
       $build['#attached']['library'][] = 'cssjs/val_master';
       return $build;
     }

   }