devangi
devangi

Reputation: 17

Error while using Azure Mobile Apps - Javascript Client SDK

I am developing ionic mobile app. I have followed these documents https://github.com/azure/azure-mobile-apps-js-client and https://github.com/azure-appservice-samples/ContosoMoments/tree/master/src

When I inject 'mobileServicesClient' in my controller, I am getting unknown provider error. If I use directly in function like this

var clientRef = new MobileServiceClient('https://******.azurewebsites.net');
clientRef.login('aad').then(function(result){ console.log(result); },function(result){ console.log(result); }

I am getting error : 'MobileServiceClient is not defined'

Upvotes: 0

Views: 228

Answers (2)

Gary Liu
Gary Liu

Reputation: 13918

As you are using ionic framework to implement your client application, you can try to use Apache Cordova plugin for Azure Mobile Apps as the client SDK.

And especially to ionic based applications, you can refer to https://github.com/Microsoft/azure-mobile-apps-with-ionic for the starter example project of azure mobile apps with ionic.

Any further concern, please feel free to let me know.

Upvotes: 0

VadimB
VadimB

Reputation: 5711

Add script reference to your object before using it.

<script src="https://zumo.blob.core.windows.net/sdk/azure-mobile-apps-client.2.0.0-rc1.js"></script>

And use correct namespace

var clientRef = new WindowsAzure.MobileServiceClient('https://...');

Upvotes: 1

Related Questions