use directives, factories, services in angularjs