خرید بک لینک

Vote count: 0

I have an angular project that I'm breaking out into a better file structure but I'm getting Argument 'fn' is not a function, got undefined for an error when creating a new service. Any ideas what I'm doing wrong?

app.js

angular.module('app', [
'app.controllers'
]);

angular.module('app.controllers', ['leaflet-directive', 'app.services']);

angular.module('app.services', []);

main.controller.js

angular.module('app.controllers')
.controller('MainCtrl', MainCtrl);

function MainCtrl($scope, $window, leafletData, DataService) {
    var main = this;

    main.items = DataService.GetItems();

    //Other controller stuff
};

data.service.js

angular.module("app.services")
.factory('DataService', DataService);

var DataService = function(){
    retu data = {
        getItems: function(){
            retu [//data here];
        }
    };
}

asked 25 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 9 ارديبهشت 1395 ساعت: 8:31

صفحه بندی