updated sample directive to include controller and factory