Hook for a JS library in a custom module not working drupal 8 Well I have created a JS to validate a form, and when I try to attach the hook in my custom module the JS its not showing. My custom module it's call "ajax_form"

My ajax_form.libraries.yml

ajax_form:
  version: 1
  js:
    js/ajax_form.js: {}
  dependencies:
      - core/jquery


My ajax_form.module

&lt;?php
function ajax_form_page_attachments(array &amp;$attachments) {
    $attachments['#attached']['library'][] = 'ajax_form/ajax_form';
}


I have a console.log('test'); in the first line of my JS but this is not displaying.

I have run out of ideas of what it be. Also I'm new to Drupal maybe is that.
Just wrong indentation. Dependencies need two spaces indentation:

ajax_form:
  version: 1
  js:
    js/ajax_form.js: {}
  dependencies:
    - core/jquery