Skip to content

Commit bb414c0

Browse files
refact(chapter-9): Make each module a different name so that don't conflict when running unit tests
1 parent 311ef4d commit bb414c0

File tree

26 files changed

+10
-10
lines changed

26 files changed

+10
-10
lines changed

1820EN_09_Code/02 - button directive/directive.js renamed to 1820EN_09_Code/02_button_directive/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('directives', [])
1+
angular.module('button-directive', [])
22

33
.directive('button', function() {
44
return {

1820EN_09_Code/02 - button directive/directive.spec.js renamed to 1820EN_09_Code/02_button_directive/directive.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('button directive', function () {
22
var $compile, $rootScope;
3-
beforeEach(module('directives'));
3+
beforeEach(module('button-directive'));
44
beforeEach(inject(function(_$compile_, _$rootScope_) {
55
$compile = _$compile_;
66
$rootScope = _$rootScope_;

1820EN_09_Code/03 - link-button directive/directive.js renamed to 1820EN_09_Code/03_link-button_directive/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('directives', [])
1+
angular.module('link-button-directive', [])
22

33
.directive('linkButton', function() {
44
return {

1820EN_09_Code/03 - link-button directive/directive.spec.js renamed to 1820EN_09_Code/03_link-button_directive/directive.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('linkButton directive', function () {
22
var element;
3-
beforeEach(module('directives'));
3+
beforeEach(module('link-button-directive'));
44
beforeEach(inject(function($compile, $rootScope) {
55
element = $compile('<link-button type="primary" size="large" href="#link1">Click Me!</link-button>')($rootScope);
66
}));

1820EN_09_Code/04 - pagination directive/directive.js renamed to 1820EN_09_Code/04_pagination_directive/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('directives', [])
1+
angular.module('pagination-directive', [])
22

33
.directive('pagination', function() {
44
return {

1820EN_09_Code/04 - pagination directive/directive.spec.js renamed to 1820EN_09_Code/04_pagination_directive/directive.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('pagination directive', function () {
22
var $rootScope, element;
3-
beforeEach(module('directives'));
3+
beforeEach(module('pagination-directive'));
44
beforeEach(inject(function(_$compile_, _$rootScope_) {
55
$compile = _$compile_;
66
$rootScope = _$rootScope_;

1820EN_09_Code/06 - unique-email directive/directive.js renamed to 1820EN_09_Code/06_unique-email_directive/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('directives', [])
1+
angular.module('unique-email-directive', [])
22

33
/**
44
* A validation directive to ensure that the model contains a unique email address

1820EN_09_Code/06 - unique-email directive/directive.spec.js renamed to 1820EN_09_Code/06_unique-email_directive/directive.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe('uniqueEmail directive', function() {
22
var $scope, testInput, Users;
33

4-
beforeEach(module('directives'));
4+
beforeEach(module('unique-email-directive'));
55
beforeEach(module('mock.Users'));
66

77
beforeEach(inject(function($compile, $rootScope, _Users_){

1820EN_09_Code/07 - jQuery datepicker directive/directive.js renamed to 1820EN_09_Code/07_jQuery_datepicker_directive/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('directives', [])
1+
angular.module('date-picker-directive', [])
22

33
.directive('datePicker', function () {
44
return {

1820EN_09_Code/07 - jQuery datepicker directive/directive.spec.js renamed to 1820EN_09_Code/07_jQuery_datepicker_directive/directive.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('date-picker directive', function() {
55
$.datepicker._selectDate(element);
66
};
77

8-
beforeEach(module('directives'));
8+
beforeEach(module('date-picker-directive'));
99
beforeEach(inject(function(_$compile_, _$rootScope_) {
1010
$compile = _$compile_;
1111
$rootScope = _$rootScope_;

0 commit comments

Comments
 (0)