0

I have simple problem with angularjs

Services.js

'use strict'

var restData = angular.module('ccapp.services', ['ngResource']);

restData.factory('Testcust', function ($resorce) {
    return $resorce('http://localhost:8080/CallCenterRest/webresources/testcust',{},{
       query:{method:'GET', isArray:true} 
    });
});

app.js

var app = angular.module('ccapp', [
    'ngRoute',
    'ccapp.services']);
app.config(function ($routeProvider) {
    $routeProvider
        .when('/viat',
            {
                controller: 'viatctrl',
                templateUrl: 'pages/viat.html'
            })

        .otherwise({ redirectTo: 'index.html' });
});

problem is

Uncaught Error: [$injector:modulerr] Failed to instantiate module ccapp due to: Error: [$injector:modulerr] Failed to instantiate module ccapp.services due to: Error: [$injector:nomod] Module 'ccapp.services' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

somebody can help :)

2
  • 1) See stackoverflow.com/questions/18287482/… 2) Do you have many questions ? One question -> one question mark Commented Feb 3, 2015 at 7:41
  • 2
    Are you including the scripttag with services.js before the scripttag with app.js? Commented Feb 3, 2015 at 7:41

1 Answer 1

2

Check the index.html file to ensure that Services.jsis included by a script tag like so <script src="whatever-your-path-is/Services.js"></script>.

If your project was set up such that a grunt or gulp task compiles all javascript files into one file (e.g., my-app.js) to be included in index.html by a script tag, then you need to make sure that this Service.js file is on the path to be processed by the grunt or gulp task.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.