Authentication with loopback and angular
<p>I am attempting to perform authentication with loopbackJS as a backend provider. After following the documentation on loopback's doc site I'm still receiving an "Unknown Provider error".</p>

<p>Here is the following code I've written so far. </p>

<p><strong>Home View</strong></p>

<pre><code>&lt;form class="centered" ng-controller="UserController as user"&gt;
&lt;div class ="form-group"&gt;
    &lt;label for="exampleEmail"&gt;Email&lt;/label&gt;
    &lt;input class="form-control" type="text" name="email" placeholder="{{user.usernames.email}}"&gt;
    &lt;label for="examplePassword"&gt;Password&lt;/label&gt;
    &lt;input class="form-control" type="password" name="password" placeholder="{{user.usernames.password}}"&gt;
    &lt;p&gt;{{user.description}}&lt;/p&gt;
    &lt;button class="button" ng-show="user.usernames.signin" ng-submit="login()"&gt;login&lt;/a&gt; &lt;/button&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p><strong>Auth Controller</strong></p>

<pre><code>var app = angular.module('app')
app.controller('UserController', ['$scope','AuthService', '$state', function($scope, AuthService, $state){
    $scope.user = {
      email: 'foo@bar.com',
      password: 'foobar'
    };

        $scope.login = function() {
      AuthService.login($scope.user.email, $scope.user.password)
        .then(function() {
          $state.go('success');
        });
    };


}]);
</code></pre>

<p><strong>Index.html</strong></p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html ng-app="app"&gt;
&lt;head&gt;
    &lt;title&gt;Todo Application&lt;/title&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
    &lt;link href="css/style.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;header ng-include="'views/header.html'"&gt;&lt;/header&gt;
&lt;body&gt;


&lt;ui-view&gt;&lt;/ui-view&gt;

    &lt;script src="vendor/angular.js"&gt;&lt;/script&gt;
    &lt;script src="vendor/angular-resource.js"&gt;&lt;/script&gt;
    &lt;script src="vendor/angular-ui-router.js"&gt;&lt;/script&gt;
    &lt;script src="js/app.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="js/services/auth.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="js/controllers/auth.js"&gt;&lt;/script&gt;
    &lt;script src="js/services/lb-services.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Also, in order to provide as much detail into the problem as possible here is a look at the errors presently in my console.</p>

<p><a href="https://i.stack.imgur.com/v1sdG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v1sdG.png" alt="enter image description here"></a></p>

<p>Thanks in advance for the help, it's greatly appreciated.</p>