Angular 2 use of directive

20 views
Skip to first unread message

Ovais Khan

unread,
Oct 25, 2016, 9:18:55 AM10/25/16
to Angular
Hi,

I have made a directive which is declared in the component and it has JavaScript code alert('here');

Now I want to trigger that directive in the component when my service send me the response from the server.

Please tell me how I can use this things?

Waiting for your positive response.

Sander Elias

unread,
Oct 31, 2016, 1:01:40 AM10/31/16
to Angular
Hi Ovais,

use a @input on your directive. If you just need some reusable functionality, you are probably better off using a service instead of a directive.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages