[Solved] Error: [ng:areq] Argument ‘fn’ is not a function, got string


SOLVED

I added this library:

<script src="https://stackoverflow.com/questions/51248557/bower_components/angular-ui-router/release/angular-ui-router.js"></script>

app.js is updated

'use strict';
(function () {
let myApp = angular.module('myApp', ['ui.router']);

    myApp.controller('userController', ['$http', function ($http) {
        let vm = this;
        $http.get("http://localhost:8080/Market/users").then(function (response) {
            vm.usersForm = response.data;
        })
    }]);

    myApp.config('$stateProvider', [ function($stateProvider) {

        $stateProvider.state('index', {
            url: "http://localhost:63342/demo2/app/",
            templateUrl: "index.html",
            controller: "userController"
        })
    }]);

}());

index.html is updated

<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>My AngularJS App</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://stackoverflow.com/questions/51248557/bower_components/angular/angular.js"></script>
  <script src="bower_components/angular-route/angular-route.js"></script>
  <script src="bower_components/angular-loader/angular-loader.js"></script>
  <script src="https://stackoverflow.com/questions/51248557/bower_components/angular-ui-router/release/angular-ui-router.js"></script>
  <script src="app.js" type="text/javascript"></script>
</head>

<body>
<div ng-app="myApp" ng-controller="userController as vm">

    <label>{{vm.usersForm.firstName}}</label>

</div>
</body>
</html>

solved Error: [ng:areq] Argument ‘fn’ is not a function, got string