Skip to content

Commit 48ca80d

Browse files
committed
fix(uiCreditCardMask): rename "uiCreditCard" to "uiCreditCardMask"
BREAKING CHANGE the "ui-credit-card" mask was renamed to "ui-credit-card-mask"
1 parent 640aa7f commit 48ca80d

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/global/credit-card/credit-card.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<body ng-app="app">
1717
<form name="form" ng-controller="ctrl">
1818
<h2>ui-br-phone-number</h2>
19-
<input type="text" name="freeLinePhoneNumber" ng-model="freeLinePhoneNumber" ng-model-options="{allowInvalid:true}" ui-credit-card><br>
19+
<input type="text" name="freeLinePhoneNumber" ng-model="freeLinePhoneNumber" ng-model-options="{allowInvalid:true}" ui-credit-card-mask><br>
2020
<span ng-bind="freeLinePhoneNumber">-</span> - {{form.freeLinePhoneNumber.$error}}<br>
2121
<br>
22-
<input type="text" name="creditCard" ng-model="creditCard" ng-model-options="{allowInvalid:true}" ui-credit-card><br>
22+
<input type="text" name="creditCard" ng-model="creditCard" ng-model-options="{allowInvalid:true}" ui-credit-card-mask><br>
2323
<span ng-bind="creditCard">-</span> - {{form.creditCard.$error}}<br>
2424
<br>
25-
<input type="text" name="initializedCC" ng-model="initializedCC" ng-model-options="{allowInvalid:true}" ui-credit-card><br>
25+
<input type="text" name="initializedCC" ng-model="initializedCC" ng-model-options="{allowInvalid:true}" ui-credit-card-mask><br>
2626
<span ng-bind="initializedCC">-</span> - {{form.initializedCC.$error}}<br>
2727
</form>
2828
</body>

src/global/credit-card/credit-card.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
describe('uiCreditCard', function() {
3+
describe('uiCreditCardMask', function() {
44
it('should load the demo page', function() {
55
browser.get('/src/global/credit-card/credit-card.html');
66
expect(browser.getTitle()).toEqual('Credit Card Spec');

src/global/credit-card/credit-card.test.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
require('../global-masks');
44

5-
describe('ui-credit-card', function() {
5+
describe('uiCreditCardMask', function() {
66
beforeEach(angular.mock.module('ui.utils.masks.global'));
77

88
it('should throw an error if used without ng-model', function() {
99
expect(function() {
10-
TestUtil.compile('<input ui-credit-card>');
10+
TestUtil.compile('<input ui-credit-card-mask>');
1111
}).toThrow();
1212
});
1313

1414
it('should register a $parser and a $formatter', function() {
1515
var input = TestUtil.compile('<input ng-model="model">');
1616
var model = input.controller('ngModel');
1717

18-
var maskedInput = TestUtil.compile('<input ng-model="maskedModel" ui-credit-card>');
18+
var maskedInput = TestUtil.compile('<input ng-model="maskedModel" ui-credit-card-mask>');
1919
var maskedModel = maskedInput.controller('ngModel');
2020

2121
expect(maskedModel.$parsers.length).toBe(model.$parsers.length + 1);
2222
expect(maskedModel.$formatters.length).toBe(model.$formatters.length + 1);
2323
});
2424

2525
it('should format initial model values', function() {
26-
var input = TestUtil.compile('<input ng-model="model" ui-credit-card>', {
26+
var input = TestUtil.compile('<input ng-model="model" ui-credit-card-mask>', {
2727
model: '4242424242424242'
2828
});
2929

@@ -32,8 +32,7 @@ describe('ui-credit-card', function() {
3232
});
3333

3434
it('should ignore non digits', function() {
35-
var input = TestUtil.compile('<input ng-model="model" ng-model-options="{allowInvalid:true}"' +
36-
' ui-credit-card>');
35+
var input = TestUtil.compile('<input ng-model="model" ng-model-options="{allowInvalid:true}" ui-credit-card-mask>');
3736
var model = input.controller('ngModel');
3837

3938
var tests = [
@@ -54,7 +53,7 @@ describe('ui-credit-card', function() {
5453
});
5554

5655
it('should validate a credit card number', function() {
57-
var input = TestUtil.compile('<input ng-model="model" ui-credit-card>', {
56+
var input = TestUtil.compile('<input ng-model="model" ui-credit-card-mask>', {
5857
model: '417900'
5958
});
6059

@@ -65,7 +64,7 @@ describe('ui-credit-card', function() {
6564
});
6665

6766
it('should use the type of the model value (if initialized)', function() {
68-
var input = TestUtil.compile('<input ng-model="model" ui-credit-card>', {
67+
var input = TestUtil.compile('<input ng-model="model" ui-credit-card-mask>', {
6968
model: '7777333300008888'
7069
});
7170

src/global/global-masks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var m = angular.module('ui.utils.masks.global', [])
4-
.directive('uiCreditCard', require('./credit-card/credit-card'))
4+
.directive('uiCreditCardMask', require('./credit-card/credit-card'))
55
.directive('uiDateMask', require('./date/date'))
66
.directive('uiMoneyMask', require('./money/money'))
77
.directive('uiNumberMask', require('./number/number'))

0 commit comments

Comments
 (0)