M
M
Maxim Ivanov2017-01-08 23:16:24
Angular
Maxim Ivanov, 2017-01-08 23:16:24

How to call plugin from Angular2 directive?

If you call through the console yourself:
For example, like this:

$(document.getElementsByTagName('select')[0]).material_select()

the plugin works But material_select.ts
does not work through the directive
import { Directive, ElementRef, Renderer } from '@angular/core';
declare var $: any;

@Directive({
  selector: `[materializeSelect]`
})
export class SelectDirective {
  constructor(el: ElementRef, renderer: Renderer) {

    console.log(el.nativeElement)
    console.log($(el.nativeElement))
    

    try {

        $(el.nativeElement[0]).material_select()
   
    } catch (e) {
      console.warn(e)
    }

  }
}

Although the DOM itself is displayed in the console, it is not clear how to fix the error itself and call the plugin for the element to which the directive is applied
b090c7a84ee04011b5f0a707877c2057.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
1
15432, 2017-06-24
@15432

Try updating the firmware
https://www.kingston.com/en/support/technical/down...
if less than three years have passed since the purchase, you can change it under warranty

A
Artem @Jump, 2017-06-24
Tag curated by

1) See what SMART says - if everything is bad, then no questions asked in the trash.
2) Update the firmware.
3) Make Secure Erase
Then run it in test mode - if there is even the slightest problem, it will not arise in the trash, you can use it, but with caution.
Still, disks, memory are consumables, if there are failures, you need to change them without pity.

G
GreyAlex, 2017-07-02
@GreyAlex

Thanks for answers. I will ride it and see.
Firmware, oddly enough, the latest. The flashing program writes that the disk is generally in perfect condition)
They suggested that it seemed to fly out due to the fact that its temperature jumped sharply and, oddly enough, Kingston SSD Manager writes that it actually had jumps up to 70 degrees.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question