Posts

Showing posts from September, 2015

Adding and deleting Angular directives dynamically (Part 1)

Image
There comes a time in the development of angular applications when you get into the nitty -gritty of directives. Yes, of course, it was the first thing slammed at you when you started with angular and you soon began to enjoy using ng-this and ng-that. But now writi-'ng' one of those and manipulati-'ng' them dynamically? OMG!! Its like when someone threw this at your face. At first you say "Whaaaa?"  Then you lick a little off and say "Hmm!"  Then you lick some more and say "mmmmmmmmmmmmm" And then you're asked to make something like that. From scratch. My reaction? Alright alright, getting to the point! Ill use this post as the first of three posts, each post covering the following: 1. Write a directive (duh! aren't these a gazillion posts already?) But Ill be using this directive to explore # 2 and #3, hence the introduction.  2. Add a directive dynamically .  3. Remove a directive dynamically . Th