Kann nicht Werk-oder Dienstleistung anerkannt werden, die im controller mit angluarjs Verwendung von angular-seed

Dass ich immer "undefined ist nicht eine Funktion" beim aufrufen der Fabrik. Ich bin mit dem angular-seed als Rahmen für mein setup. Für einige Grund, es nicht erkannt "GetFormVals" als gültiges Werk.

In app.js:

var app = angular.module('myApp', ['myApp.filters',
'myApp.services', 'myApp.directives'], function($routeProvider, $locationProvider) {
    //route declarations
    $routeProvider.when('/fsr', {
        templateUrl: 'partials/fsr.html',
        controller: ctrlFSR
    });

    $locationProvider.html5Mode(true);
});

In controllers.js:

function ctrlFSR($scope, $http, $location, GetFormVals) {
    $scope.test = GetFormVals();
}
ctrlFSR.$inject = ['$scope','$location'];

In services.js:

'use strict';

/* Services */

angular.module('myApp.services', []).
    factory('GetFormVals', function(){
    return "test";
});

Bin ich etwas fehlt einfach.

jsfiddle: http://jsfiddle.net/wUjw5/11/

InformationsquelleAutor Jeff Tidwell | 2013-01-03
Schreibe einen Kommentar