setup factory, controller and directive format of connection