segregated the template -so that the directive could be used as a widget