Angular 5 — крючок жизненного цикла в директивеJquery

Программирование на jquery
Ответить
Anonymous
 Angular 5 — крючок жизненного цикла в директиве

Сообщение Anonymous »


I am new to Angular 5.
I have created the directive for the external JS library.
But in the same directive, I am binding value to the attribute.

I am trying to sue ngAfterViewInit to detect whether all the values are bound to the attribute and then call the jQuery plugin.

But I have find life cycle hook only for the component. Can I use those in directive? Is that a good choice?

If I don't use ngAfterViewInit, then when I call jQuery plugin, the values are not bound.
If I use that, the attribute values are ready when I call the jQuery plugin.


Источник: https://stackoverflow.com/questions/487 ... -directive
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Jquery»