setup ctrl and directive