title: Point of using Services for simple utility functions in angular
body: <p>I have a question about services in angular.</p>
  
  <p>Let's say I have this simple service:</p>
  
  <pre><code> @Injectable()
   export class ApplicationUtilsService {
  
   constructor() {
  }
  
   checkIfObjectExistAndGet(map: Map&lt;string, Object&gt;, sectionName: string): Object {
       return map.has(sectionName) ? map.get(sectionName) : {};
     }
  
  }
  </code></pre>
  
  <p>Why not just create and export a function:</p>
  
  <pre><code>export function  checkIfObjectExistAndGet(map: Map&lt;string, Object&gt;, sectionName: string): Object {
   return map.has(sectionName) ? map.get(sectionName) : {};
  </code></pre>
  
  <p>}</p>
  
  <p>That way I can import it whenever I want to use it. Don't need to inject it into component so tests are little easier to create (I dont need to provide service or create mock).</p>
  
  <p>So I'm wondering if those type of functions should be provided by services or is it ok to just create it as in example above and import?</p>