저는 Azure 모바일 서비스를 ionic과 함께 사용하고 있으며 클라이언트를 싱글 톤으로 공장에서 만들려고합니다. 그러나 내가 정상적으로했던 것처럼 클라이언트를 사용하려고 할 때이 오류가 계속 발생합니다. 오류 : 변수를 찾을 수 없습니다 : WindowsAzure. 미리 감사드립니다. 내가 전화오류 : 변수를 찾을 수 없습니다. WindowsAzure
공장
.factory('client', [function(){
var myjsonObj = new WindowsAzure.MobileServiceClient('https://xxx.azurewebsites.net');
return myjsonObj;
}])
컨트롤러
내가있는 스크립트를 추가를 통해 수동으로 플러그인 모바일 서비스를 추가하기로 결정 그래서 오류를 조사하고 결과를 찾지 못하는 한 후.controller('loginCtrl', ['$scope', '$stateParams', 'md5', 'Userid', '$state','$ionicSideMenuDelegate','$ionicLoading','client',// The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
// You can include any angular dependencies as parameters for this function
// TIP: Access Route Parameters for your page via $stateParams.parameterName
function ($scope, $stateParams,md5,Userid,$state,$ionicSideMenuDelegate,$ionicLoading,client) {
$scope.UserInfo = {};
$ionicSideMenuDelegate.canDragContent(false);
$scope.show = function() {
$ionicLoading.show({
template: '<p>Loading...</p><ion-spinner></ion-spinner>'
});
};
$scope.hide = function(){
$ionicLoading.hide();
};
$scope.login =function(){
$scope.show($ionicLoading);
if ($scope.UserInfo.password == null){
$scope.UserInfo.password = "fa";
}
var query = client.getTable('clubUser')
.where({ Email: $scope.UserInfo.email, Password: md5.createHash($scope.UserInfo.password) })
.read()
.done(function(results) {
if(results[0] == undefined)
{
$scope.errorText = "Error: Wrong Username/Password";
$scope.$apply();
$scope.hide($ionicLoading);
}
else
{
$scope.hide($ionicLoading);
Userid.setJson(results[0].id);
$state.go('tabsController.qRCode');
}
}, function(error) {
console.dir(error);
$scope.hide($ionicLoading);
});
$scope.UserInfo.password = "";
};
}])
스크립트가로드되지 않은 것 같습니다. npm 패키지 또는 스크립트를 사용하고 있습니까? –
나는 내 프로젝트를 cmd에 위치 시켰고 cordova 플러그인을 사용하여 cordova-plugin-ms-azure-mobile-apps를 설치했다. @Volodymyr Bilyachat – Dedawg
Cordova 플러그인은 모바일에서만 작동하며 브라우저에서 실행 중이라고 가정합니다. –