Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dears ,

I'm trying to do the following :
JavaScript
var common = angular.module('common', ['ui.bootstrap']);

var app = angular.module('app', ['common']);


(function (cr) {
    var modelHelper = function () {
        var self = this;
        self.getObjectById = function (object, key, value) {
            angular.forEach(object, function (objKey, objValue) {
                var a = 0;
            });
            return undefined;
        };
    };
    cr.modelHelper = modelHelper;
}(window.sys));


dgitCommon.factory('modelHelper', function () {
    return sys.modelHelper();
});

and its not injecting the 'modelHelper' into the controller like bellow :

JavaScript
app.controller("xController", function ($scope, $modal, modelHelper) {

});


Thanks in advance .
Posted

1 solution

JavaScript
(function (cr) {
    var modelHelper = function () {
        var self = this;
        self.getObjectById = function (object, key, value) {
            angular.forEach(object, function (objKey, objValue) {
                var a = 0;
            });
            return undefined;
        };
return this ;/// this what i forget to code
    };
    cr.modelHelper = modelHelper;
}(window.sys));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900