Refactored the directive to make use of a child controller instead of an isolate scope