AngularJS functions in the factory cannot be accessed from the controller
<p>Im new to angular js.
Can anyone please tel me why i get an error saying functions in the factory cannot be accessed from the controller.</p>

<blockquote>
  <p>Error: UserService.getAllCustomers is not a function</p>
</blockquote>

<p>This happens when I add</p>

<pre><code>  App.service('UserService', function () { })
</code></pre>

<p>to the controller.
If this is not added it gives</p>

<blockquote>
  <p>Error: [$injector:unpr] Unknown
  provider:serServiceProvider&lt;-UserService&lt;- UserController</p>
</blockquote>