任何人都知道我为什么在这个Angular代码上获得Unknown provider?
我正在使用Angular File Upload指令并使用此示例:
只是似乎无法弄清楚为什么我收到这个错误...
module.js文件:
angular.module('photoApp', ['ngRoute']);
Run Code Online (Sandbox Code Playgroud)
scripts.js文件:
// configure our routes
angular.module('photoApp').config(function ($routeProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl: 'Pages/home.html',
controller: 'mainController'
})
// route for the contact page
.when('/uploadphoto', {
templateUrl: 'Pages/photoupload.html',
controller: 'photoUploadController'
});
});
// create the controller and inject Angular's $scope
angular.module("photoApp").controller('photoUploadController',
function ($scope, $http, $timeout, $upload) {
$scope.message = 'Upload your photo';
$scope.upload = [];
$scope.fileUploadObj = { testString1: "Test string 1", testString2: "Test string 2" …Run Code Online (Sandbox Code Playgroud)