1
I have a slight difficulty in understanding how to install these plugins, in general they never work for lack of some file I haven’t called or anything like that.
For example, this facebook plugin that phonegap forces you to use for better performance results, https://github.com/Wizcorp/phonegap-facebook-plugin. Browser method via ngCordova: http://ngcordova.com/docs/plugins/facebook/
I install it via git-shell, all right. I move the js file to the js folder of my root, I call this js on index, but even so, when I call the function, it tells me it is undefined.
There is something else I need to know when installing these plugins?
Grateful From Now!
Edit:
I’m trying to insert the method this way:
myApp.config(function($cordovaFacebookProvider) {
var appID = 123456789;
var version = "v2.0"; // or leave blank and default is v2.0
$cordovaFacebookProvider.browserInit(appID, version);
});
But the following error appears: Uncaught Error: [$injector:modulerr]
I tried this way, but it didn’t work either:
$scope.testeButton = function(name,description,image){
myApp.config(["$cordovaFacebookProvider",function($cordovaFacebookProvider) {
var appID = xxxxxxxxxx;
var version = "v2.5"; // or leave blank and default is v2.0
$cordovaFacebookProvider.browserInit(appID, version);
console.log('aqui');
}]);
var options = {
method: "feed",
link: "http://example.com",
caption: "Such caption, very feed."
};
$cordovaFacebook.showDialog(options)
.then(function(success) {
// success
}, function (error) {
// error
});
}
Appeared cordovaFacebook is not defined
I think we need to inject
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ngCordova', 'ui.utils.masks'])
. So for example.– leopiazzoli
I understood what you meant, but what would inject this plugin?
– Michel Henriq
Good question, reading better documentation does not say about injecting :(
– leopiazzoli
I get confused in these plugins because the explanation is very succinct.
– Michel Henriq
I found out that I have to inject a $cordovaFacebook into my module.config, http://ngcordova.com/docs/plugins/facebook/.<br /> The problem now is that I add this under my myapp, but there is an error in the app.
– Michel Henriq
Try to edit the question and show the error that is giving, will be better to understand.
– leopiazzoli
it seems that the way I’m trying to install, does not accept. <br />
Uncaught Error: [$injector:modulerr]
– Michel Henriq