title: Drupal 8 jQuery is undefined in module twig view
body: <p>I am trying to develop my first Drupal 8 module and I cannot understand why jQuery is undefined in my twig template.</p>
  <p>In my block I call controller function:</p>
  <pre><code>public function build() {
      $config = $this-&gt;getConfiguration();
      $slider = new OsTouchController;
  
      return $slider-&gt;displaySlider($config['id']);    
  }
  </code></pre>
  <p>Then in controller:</p>
  <pre><code>public function displaySlider($slider_id) {
      $oss_params = $this-&gt;getSliderParams($slider_id);
      return array(
        '#theme' =&gt; 'slider_default',
        '#oss_params' =&gt; $oss_params,
        '#attached' =&gt; array(
              'library' =&gt;  array(
                  'ostouch_slider/ostouch.slider' 
              ),
          ),
      );
  }
  </code></pre>
  <p>and finally in twig I have such script code:</p>
  <pre><code>jQuery(document).ready(function($) {
        var mySliderSetings = new osSliderSettings(&quot;#dragable-settings-block&quot;,{
          crop :                        {{ oss_params.crop_image }},
          parallax :                    {{ oss_params.parallax }},
          imageWidth:                   {{ oss_params.image_width }},
          imageHeight:                  {{ oss_params.image_height }},
          site_path :                   '{{ &quot;http://&quot; }}',
          moduleId :                    {{ oss_params.modId }},
          lazyLoading :                 {{ oss_params.lazyLoading }},
          lazyLoadingInPrevNext :       {{ oss_params.lazyLoadingInPrevNext }},
          lazyLoadingInPrevNextAmount : {{ oss_params.lazyLoadingInPrevNextAmount }},
          textOrdering:                 {{ oss_params.textOrdering }},
          screenW :                     screenW,
          screenH :                     screenH,
          setupAnimation :              setupAnimation,
          swiperSlider :                mySwiper
        });
      });
  </code></pre>
  <p>Of course I get an error:</p>
  <blockquote>
  <p>&quot;Uncaught ReferenceError: jQuery is not defined&quot;</p>
  </blockquote>
  <p>because all scripts includes are in the bottom of the page.</p>
  <p>I can't find function for script which can help me to display my script code in the bottom of the page.
  I can't write this code in js file because params in script can changes.
  I can read params from hidden input but I think in Drupal exist another way...</p>
  <p>Who can help me? What I did wrong?</p>