0
erklärt a ServiceAccess Service innerhalb Controller
calculator_app.service('FullPath', function() {
this.full_path = function (pt, pg, prt, cd,scpe) {
-- some logic---
};});
erklärt der Controller-
calculator_app.controller("Opportunity_Controller", ['$scope', '$http', 'ngDialog', 'FullPath', 'FillOpportunity', function ($scope, FullPath, FillOpportunity, $http, ngDialog) {
$scope.find_path = function() {
$scope.result_path = FullPath.full_path($scope.res_pt, $scope.res_pg, $scope.res_prt, $scope.res_cd, $scope);
}]);
Die Linie FullPath.full_path Fehler als FullPath wirft nicht definiert ist ....
Danke. Das löst. Ich kann jedoch nicht auf ngDialog zugreifen. ngDialog ist nicht definiert, wenn ich console.log $ scope.calculate_opportunity = function (ngDialog) { ngDialog.open ({template: '
I am Ng Dialog
Ich thik Sie Havent ändern Sie den Code gründlich wie in der Antwort vorgeschlagen –