Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs($httpBackend): add module declaration for best understanding purposes #9563

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,11 @@ angular.mock.dump = function(object) {
* First we create the controller under test:
*
```js
// The module code
angular
.module('MyApp', [])
.controller('MyController', MyController);

// The controller code
function MyController($scope, $http) {
var authToken;
Expand Down Expand Up @@ -1022,6 +1027,9 @@ angular.mock.dump = function(object) {
// testing controller
describe('MyController', function() {
var $httpBackend, $rootScope, createController, authRequestHandler;

// Set up the module
beforeEach(module('MyApp'));

beforeEach(inject(function($injector) {
// Set up the mock http service responses
Expand Down