Anyone ?!
Em quinta-feira, 15 de maio de 2014 00h26min55s UTC-3, Diego Freitas
escreveu:
>
> Hi there,
>
> I'm facing a problem that I really don't know the reason of it ...
>
> My controller is undefined ...
>
> *karma.config:*
>
>> files: [
>> '../contents/js/jquery-1.10.2.js',
>> '../contents/js/angular.min.js',
>> '../contents/js/angular-route.js',
>> '../contents/js/angular-mocks.js',
>> '../contents/js/bootstrap.js',
>> '../contents/js/bootstrap.min.js',
>> '../contents/js/*.js',
>> '../app/app.js',
>> '../app/controllers/*.js',
>> '../app/services/*.js',
>> '../app/*',
>> {pattern: 'spec/**/*Spec.js', included: true},
>> ],
>
>
> *Controller and service and app*
>
> var moduleApp = angular.module('contactListApp', ['ngRoute',
>> 'ui.bootstrap']);
>> moduleApp.controller('ContactController', function ($scope, $modal,
>> $timeout, ContactService) { ....}
>> moduleApp.service('ContactService', function ($http, $q, config) { ...}
>
>
>
> *Test:*
> describe('ContactController - Testing CRUD Operations', function(){
> var ContactController, scope, ContactService;
>
> beforeEach(module('contactListApp'));
> // Initialize the controller and a mock scope
> beforeEach( inject(function ($controller, $rootScope, ContactService) {
> scope = $rootScope.$new();
> ContactController = $controller('ContactController', {
> $scope: scope
> }); *//AFTER THIS CONTROLLER STILL UNDEFINED. IF I SEE THE CONTROLLER
> IN DEBUG MODE IT WILL ONLY HAVE AN _OBJECT ... BUT NO FUNCTIONS*
> ContactService = ContactService;
> }));
>
> it('testing', function(){
> expect(ContactController.hasAlertVisible).toBe("false");
> });
> });
>
> Does anyone know why is not injecting ?!!
>
> Thanks !!!
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.