I am trying to execute a function after a video ends, the function is inside an angular controller. The function is called, but I get an error stating:
ReferenceError: postVendor is not defined
Here is the calling javascript:
$.noConflict();
jQuery(document).ready(function ($) {
var api = flowplayer();
api.bind("finish", function (e, api) {
var data = "true";
var url = "someurlhere";
postVendor(url, data);
});
});
and here is my module/controller (same file):
var registrationModule = angular.module('registrationModule', []);
registrationModule.controller("vendorCtrl", function ($scope, $http) {
$scope.postVendor = function (url, data) {
$http.post(url, data).success(function (data) { console.log(data) }).error(function (data) { console.log(data) });
};
});
in my html:
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="registrationModule">
<body ng-controller="vendorCtrl">
I am using angular 1.2.25.
Any ideas on how to get the function called properly?