I am having trouble calling a function in another controller that is in another module. I don't know if this is possible, but this is what I have now:
angular.module('search.controllers', ['socket.services', 'recipe.controllers'])
.controller('SearchCtrl', ['$scope', '$state', 'socketService', 'recipeCtrl',
function($scope, $state, socketService, recipeCtrl) {
recipeCtrl.setRecipe({});
}
]);
angular.module('recipe.controllers', [])
.controller('recipeCtrl',
function($scope) {
this.onRecipeSelect = function(recipe) {
console.log(JSON.stringify(recipe));
}
}
);
This is giving me the error:
Unknown provider: recipeCtrlProvider <- recipeCtrl <- SearchCtrl
Anyone know how to accomplish what I am trying to do?