AngularJS directive factory?

43 views
Skip to first unread message

RI Khan Shamim

unread,
Apr 25, 2017, 4:28:18 AM4/25/17
to Angular and AngularJS discussion
Is is possible to create AngularJS create directive factory like service factory?

Sander Elias

unread,
Apr 25, 2017, 5:01:04 AM4/25/17
to Angular and AngularJS discussion
Hi ..,

Yes, that is possible. I did that a couple of times. Generated directives from an array. Good for stuff like icon buttons where the only real difference is the icon that's used and stuff like that.

Regards
Sander

RI Khan Shamim

unread,
Apr 25, 2017, 7:03:07 AM4/25/17
to Angular and AngularJS discussion
I tried in my way, but couldn't solve. Any sample? 

Sander Elias

unread,
Apr 25, 2017, 7:24:30 AM4/25/17
to Angular and AngularJS discussion
Hi,

No sorry, code from a closed project. Show me what you have tried, preferably in a plunk, and I will try helping you along.

Regards
Sander

Phantom

unread,
Apr 26, 2017, 4:03:52 AM4/26/17
to Angular and AngularJS discussion
How to close code on the live website?

Sander Elias

unread,
Apr 26, 2017, 6:28:00 AM4/26/17
to Angular and AngularJS discussion
Easy, make it unavailable to the internet. Not all apps are exposed to the public internet.

Phantom

unread,
Apr 27, 2017, 12:35:42 AM4/27/17
to Angular and AngularJS discussion
I know dude but if you have to make available in public, what would you do?

26 Nisan 2017 Çarşamba 13:28:00 UTC+3 tarihinde Sander Elias yazdı:

Sander Elias

unread,
Apr 27, 2017, 1:06:12 AM4/27/17
to Angular and AngularJS discussion
Hi Phantom,

There are some way's. But I rather won't use those. Also, WASM is happening, things compiled to that are way harder to read. 
Also, while wrting in TS, and compiling down using tools that minify and tree-shake, the result isn't that readable anymore anyhow!

Regards
Sander
Reply all
Reply to author
Forward
0 new messages