jjzjj

groceryInterface

全部标签

javascript - 如何将使用 $scope 的函数包含/注入(inject)到 angularjs 的 Controller 中?

我正在尝试将工厂中保存的函数库包含到Controller中。类似于这样的问题:Creatingcommoncontrollerfunctions我的主Controller是这样的:recipeApp.controller('recipeController',function($scope,groceryInterface,...){$scope.groceryList=[];//...etc.../*tryingtoretrievethefunctionshere*/$scope.groceryFunc=groceryInterface;//wouldcallng-click="gr