我正在使用AWS和angular。AWS和angularjs的問題
AWS工作正常,如果我有HTML文件中的代碼,但當我移動到一個JS文件它不起作用。
我有這樣的代碼:
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.43.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="myCtrl">
<div id="results"></div>
<input type="file" id="file-chooser" />
<button id="upload-button">Upload to S3</button>
<button ng-click = "listObjs()">Listar</button>
</body>
</html>
併爲JS:
(function(){
var myApp = angular.module('myApp', []);
myApp.controller('myCtrl',['AWS','$scope', function myCtrl($scope, AWS){
AWS.config.update({
.......
,我得到的是錯誤未知的提供:AWSProvider < - AWS < - myCtrl
預先感謝您!