angularjs - cordovaSocialSharing in ionic not working -


i'm using plugin cordovasocialshare of ngcordova make sharing on social networks in application. problem don’t have actions returned, , when analyzing adb logs, returns me following error:

i / chromium (3635): [info: island (20306)] "typeerror: can not call method 'cansharevia' of undefined / chromium (3635): scope @ $ scope.shareviawhatsapp. (file: ///android_asset/www/js/app.js: 22: 31) 

look @ code:

html

<ion-option-button class="button-dark button-facebook" ng-click="shareanywhere()">         <i class="icon ion-social-facebook icon-facebook"></i> </ion-option-button> 

angularjs

$ionicplatform.ready(function(){ $scope.shareviawhatsapp = function(message, image, link) {     $cordovasocialsharing.cansharevia("whatsapp", message, image, link).then(function(result) {         $cordovasocialsharing.shareviawhatsapp(message, image, link);     }, function(error) {         alert("cannot share on whatsapp");     }); }  $scope.shareanywhere = function() {     $cordovasocialsharing.share("this message", "this subject", "www/imagefile.png", "http://blog.nraboy.com"); }}); 

someone me please?

anyway, again, decided problem myself ...

the result:

in command line:

ionic plugin add cordova-plugin-socialsharing 

angularjs:

$scope.share = function($title, $excerpt, $permalink) {       $ioniclistdelegate.closeoptionbuttons();       window.plugins.socialsharing.share($title, $excerpt, null, $permalink); } 

html:

<ion-option-button class="button-positive button-share" ng-click="share('{{item.title}}', '{{item.excerpt}}', '{{item.permalink}}')">         <i class="icon ion-android-share-alt"></i> </ion-option-button> 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -