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

Commit dc7abef

Browse files
committed
v8.0.5
2 parents 602cf76 + c07a358 commit dc7abef

File tree

9 files changed

+78
-56
lines changed

9 files changed

+78
-56
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ branches:
99
notifications:
1010
email: false
1111
node_js:
12-
- iojs
12+
- 4.2
1313
before_install:
14-
- npm i -g npm@^2.0.0
14+
- npm i -g npm@^3.0.0
1515
- "export DISPLAY=:99.0"
1616
- "sh -e /etc/init.d/xvfb start"
1717
before_script:

dist/formly.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angular-formly JavaScript Library v8.0.4
2+
* angular-formly JavaScript Library v8.0.5
33
*
44
* @license MIT (http://license.angular-formly.com)
55
*
@@ -153,7 +153,7 @@ return /******/ (function(modules) { // webpackBootstrap
153153

154154
ngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']);
155155
ngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']);
156-
ngModule.constant('formlyVersion', ("8.0.4")); // <-- webpack variable
156+
ngModule.constant('formlyVersion', ("8.0.5")); // <-- webpack variable
157157

158158
ngModule.provider('formlyUsability', _providersFormlyUsability2['default']);
159159
ngModule.provider('formlyConfig', _providersFormlyConfig2['default']);
@@ -430,7 +430,7 @@ return /******/ (function(modules) { // webpackBootstrap
430430
Object.defineProperty(exports, "__esModule", {
431431
value: true
432432
});
433-
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("8.0.4") + "/other/ERRORS_AND_WARNINGS.md#";
433+
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("8.0.5") + "/other/ERRORS_AND_WARNINGS.md#";
434434
module.exports = exports["default"];
435435

436436
/***/ },
@@ -439,6 +439,7 @@ return /******/ (function(modules) { // webpackBootstrap
439439

440440
'use strict';
441441

442+
formlyUsability.$inject = ["formlyApiCheck", "formlyErrorAndWarningsUrlPrefix"];
442443
Object.defineProperty(exports, '__esModule', {
443444
value: true
444445
});
@@ -505,7 +506,6 @@ return /******/ (function(modules) { // webpackBootstrap
505506
}
506507
}
507508
}
508-
formlyUsability.$inject = ["formlyApiCheck", "formlyErrorAndWarningsUrlPrefix"];
509509
module.exports = exports['default'];
510510

511511
/***/ },
@@ -514,6 +514,7 @@ return /******/ (function(modules) { // webpackBootstrap
514514

515515
'use strict';
516516

517+
formlyConfig.$inject = ["formlyUsabilityProvider", "formlyErrorAndWarningsUrlPrefix", "formlyApiCheck"];
517518
Object.defineProperty(exports, '__esModule', {
518519
value: true
519520
});
@@ -832,7 +833,6 @@ return /******/ (function(modules) { // webpackBootstrap
832833
}
833834
}
834835
}
835-
formlyConfig.$inject = ["formlyUsabilityProvider", "formlyErrorAndWarningsUrlPrefix", "formlyApiCheck"];
836836
module.exports = exports['default'];
837837

838838
/***/ },
@@ -1061,6 +1061,7 @@ return /******/ (function(modules) { // webpackBootstrap
10611061

10621062
'use strict';
10631063

1064+
formlyWarn.$inject = ["formlyConfig", "formlyErrorAndWarningsUrlPrefix", "$log"];
10641065
Object.defineProperty(exports, '__esModule', {
10651066
value: true
10661067
});
@@ -1081,7 +1082,6 @@ return /******/ (function(modules) { // webpackBootstrap
10811082
}
10821083
};
10831084
}
1084-
formlyWarn.$inject = ["formlyConfig", "formlyErrorAndWarningsUrlPrefix", "$log"];
10851085
module.exports = exports['default'];
10861086

10871087
/***/ },
@@ -1090,6 +1090,7 @@ return /******/ (function(modules) { // webpackBootstrap
10901090

10911091
'use strict';
10921092

1093+
formlyCustomValidation.$inject = ["formlyUtil"];
10931094
Object.defineProperty(exports, '__esModule', {
10941095
value: true
10951096
});
@@ -1180,7 +1181,6 @@ return /******/ (function(modules) { // webpackBootstrap
11801181
}
11811182
};
11821183
}
1183-
formlyCustomValidation.$inject = ["formlyUtil"];
11841184
module.exports = exports['default'];
11851185

11861186
/***/ },
@@ -1189,6 +1189,7 @@ return /******/ (function(modules) { // webpackBootstrap
11891189

11901190
'use strict';
11911191

1192+
formlyField.$inject = ["$http", "$q", "$compile", "$templateCache", "$interpolate", "formlyConfig", "formlyApiCheck", "formlyUtil", "formlyUsability", "formlyWarn"];
11921193
Object.defineProperty(exports, '__esModule', {
11931194
value: true
11941195
});
@@ -1214,9 +1215,9 @@ return /******/ (function(modules) { // webpackBootstrap
12141215
*/
12151216
// @ngInject
12161217
function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyConfig, formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {
1218+
FormlyFieldController.$inject = ["$scope", "$timeout", "$parse", "$controller", "formlyValidationMessages"];
12171219
var arrayify = formlyUtil.arrayify;
12181220

1219-
FormlyFieldController.$inject = ["$scope", "$timeout", "$parse", "$controller", "formlyValidationMessages"];
12201221
return {
12211222
restrict: 'AE',
12221223
transclude: true,
@@ -1309,7 +1310,7 @@ return /******/ (function(modules) { // webpackBootstrap
13091310

13101311
function parseSet(key, model, newVal) {
13111312
// If either of these are null/undefined then just return undefined
1312-
if (!key || !model) {
1313+
if (!key && key !== 0 || !model) {
13131314
return;
13141315
}
13151316
// If we are working with a number then $parse wont work, default back to the old way for now
@@ -1326,7 +1327,7 @@ return /******/ (function(modules) { // webpackBootstrap
13261327

13271328
function parseGet(key, model) {
13281329
// If either of these are null/undefined then just return undefined
1329-
if (!key || !model) {
1330+
if (!key && key !== 0 || !model) {
13301331
return undefined;
13311332
}
13321333

@@ -1948,7 +1949,6 @@ return /******/ (function(modules) { // webpackBootstrap
19481949
});
19491950
}
19501951
}
1951-
formlyField.$inject = ["$http", "$q", "$compile", "$templateCache", "$interpolate", "formlyConfig", "formlyApiCheck", "formlyUtil", "formlyUsability", "formlyWarn"];
19521952

19531953
// Stateless util functions
19541954
function getDefaultOptionsOptionsTypes(type) {
@@ -1966,6 +1966,7 @@ return /******/ (function(modules) { // webpackBootstrap
19661966

19671967
'use strict';
19681968

1969+
formlyFocus.$inject = ["$timeout", "$document"];
19691970
Object.defineProperty(exports, '__esModule', {
19701971
value: true
19711972
});
@@ -1998,7 +1999,6 @@ return /******/ (function(modules) { // webpackBootstrap
19981999
}
19992000
};
20002001
}
2001-
formlyFocus.$inject = ["$timeout", "$document"];
20022002
module.exports = exports['default'];
20032003

20042004
/***/ },
@@ -2007,6 +2007,7 @@ return /******/ (function(modules) { // webpackBootstrap
20072007

20082008
'use strict';
20092009

2010+
formlyForm.$inject = ["formlyUsability", "formlyWarn", "$parse", "formlyConfig", "$interpolate"];
20102011
Object.defineProperty(exports, '__esModule', {
20112012
value: true
20122013
});
@@ -2029,8 +2030,8 @@ return /******/ (function(modules) { // webpackBootstrap
20292030
*/
20302031
// @ngInject
20312032
function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) {
2032-
var currentFormId = 1;
20332033
FormlyFormController.$inject = ["$scope", "formlyApiCheck", "formlyUtil"];
2034+
var currentFormId = 1;
20342035
return {
20352036
restrict: 'AE',
20362037
template: formlyFormGetTemplate,
@@ -2477,7 +2478,6 @@ return /******/ (function(modules) { // webpackBootstrap
24772478
return field && !!field.fieldGroup;
24782479
}
24792480
}
2480-
formlyForm.$inject = ["formlyUsability", "formlyWarn", "$parse", "formlyConfig", "$interpolate"];
24812481
module.exports = exports['default'];
24822482

24832483
/***/ },
@@ -2486,6 +2486,7 @@ return /******/ (function(modules) { // webpackBootstrap
24862486

24872487
'use strict';
24882488

2489+
addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"];
24892490
Object.defineProperty(exports, '__esModule', {
24902491
value: true
24912492
});
@@ -2726,7 +2727,6 @@ return /******/ (function(modules) { // webpackBootstrap
27262727
return (0, _otherUtils.contains)(key, '.') || (0, _otherUtils.contains)(key, '[') && (0, _otherUtils.contains)(key, ']');
27272728
}
27282729
}
2729-
addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"];
27302730
module.exports = exports['default'];
27312731

27322732
/***/ },
@@ -2735,6 +2735,7 @@ return /******/ (function(modules) { // webpackBootstrap
27352735

27362736
'use strict';
27372737

2738+
addCustomTags.$inject = ["$document"];
27382739
Object.defineProperty(exports, '__esModule', {
27392740
value: true
27402741
});
@@ -2762,7 +2763,6 @@ return /******/ (function(modules) { // webpackBootstrap
27622763
})();
27632764
}
27642765
}
2765-
addCustomTags.$inject = ["$document"];
27662766
module.exports = exports['default'];
27672767

27682768
/***/ }

dist/formly.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formly.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

other/karma.conf.es6.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function(config) {
2020
basePath: './',
2121
frameworks: ['sinon-chai', 'chai', 'mocha', 'sinon'],
2222
files: [
23-
'node_modules/lodash/index.js',
23+
'node_modules/lodash/lodash.js',
2424
'node_modules/api-check/dist/api-check.js',
2525
'node_modules/angular/angular.js',
2626
'node_modules/angular-mocks/angular-mocks.js',
@@ -54,4 +54,3 @@ function getReporters() {
5454
}
5555
return reps;
5656
}
57-

package.json

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-formly",
3-
"version": "8.0.4",
3+
"version": "8.0.5",
44
"author": "Astrism <[email protected]>",
55
"contributors": [
66
"Astrism <[email protected]>",
@@ -27,8 +27,8 @@
2727
"build:dist": "webpack --progress --colors --set-env-NODE_ENV=development",
2828
"build:prod": "webpack --progress --colors --set-env-NODE_ENV=production",
2929
"build": "npm run build:dist & npm run build:prod",
30-
"eslint:test": "eslint -c other/test.eslintrc --ignore-pattern '**/*.+(test|mock).js' src/",
31-
"eslint:src": "eslint -c other/src.eslintrc --ignore-pattern '!**/*.+(test|mock).js' src/",
30+
"eslint:test": "eslint -c other/test.eslintrc --ignore-pattern **/*.{test,mock}.js src/",
31+
"eslint:src": "eslint -c other/src.eslintrc --ignore-pattern !**/*.{test,mock}.js src/",
3232
"eslint": "npm run eslint:test -s && npm run eslint:src -s",
3333
"test": "karma start --single-run --set-env-COVERAGE=true --set-env-NODE_ENV=test",
3434
"test:watch": "karma start --set-env-COVERAGE=true --set-env-NODE_ENV=test",
@@ -54,51 +54,54 @@
5454
"api-check": "^7.0.0"
5555
},
5656
"devDependencies": {
57-
"angular": "1.4.7",
58-
"angular-mocks": "1.4.7",
59-
"api-check": "7.5.3",
60-
"argv-set-env": "1.0.0",
57+
"angular": "1.5.0",
58+
"angular-mocks": "1.5.0",
59+
"api-check": "7.5.5",
60+
"argv-set-env": "1.0.1",
6161
"babel": "5.8.23",
6262
"babel-eslint": "4.1.3",
6363
"babel-loader": "5.3.2",
64-
"chai": "3.4.0",
64+
"chai": "3.5.0",
6565
"codecov.io": "0.1.6",
66-
"commitizen": "2.3.0",
67-
"cracks": "3.1.1",
68-
"cz-conventional-changelog": "1.1.4",
66+
"commitizen": "2.7.2",
67+
"cracks": "3.1.2",
68+
"cz-conventional-changelog": "1.1.5",
6969
"deindent": "0.1.0",
7070
"eslint": "1.7.3",
7171
"eslint-config-kentcdodds": "5.0.0",
7272
"eslint-loader": "1.1.0",
7373
"eslint-plugin-mocha": "1.0.0",
74-
"ghooks": "1.0.0",
75-
"http-server": "0.8.5",
74+
"ghooks": "1.0.3",
75+
"gulp": "3.9.1",
76+
"gulp-replace": "0.5.4",
77+
"http-server": "0.9.0",
7678
"isparta": "3.1.0",
7779
"isparta-loader": "1.0.0",
78-
"istanbul": "0.4.0",
79-
"karma": "0.13.14",
80+
"istanbul": "0.4.2",
81+
"karma": "0.13.22",
8082
"karma-chai": "0.1.0",
81-
"karma-chrome-launcher": "0.2.1",
82-
"karma-coverage": "0.5.3",
83-
"karma-firefox-launcher": "0.1.6",
84-
"karma-mocha": "0.2.0",
83+
"karma-chrome-launcher": "0.2.2",
84+
"karma-coverage": "0.5.5",
85+
"karma-firefox-launcher": "0.1.7",
86+
"karma-mocha": "0.2.2",
8587
"karma-sinon": "1.0.4",
86-
"karma-sinon-chai": "1.1.0",
88+
"karma-sinon-chai": "1.2.0",
8789
"karma-webpack": "1.7.0",
88-
"lodash": "3.10.1",
89-
"mocha": "2.3.3",
90-
"ng-annotate": "1.0.2",
91-
"ng-annotate-loader": "0.0.10",
92-
"node-libs-browser": "0.5.3",
90+
"lodash": "4.6.1",
91+
"lolex": "1.4.0",
92+
"mocha": "2.4.5",
93+
"ng-annotate": "1.2.1",
94+
"ng-annotate-loader": "0.1.0",
95+
"node-libs-browser": "1.0.0",
9396
"path-here": "1.1.0",
9497
"publish-latest": "1.1.2",
9598
"raw-loader": "0.5.1",
9699
"semantic-release": "4.3.5",
97-
"sinon": "1.17.2",
100+
"sinon": "1.17.3",
98101
"sinon-chai": "2.8.0",
99-
"validate-commit-msg": "1.0.0",
100-
"webpack": "1.12.2",
101-
"webpack-notifier": "1.2.1"
102+
"validate-commit-msg": "2.3.1",
103+
"webpack": "1.12.14",
104+
"webpack-notifier": "1.3.0"
102105
},
103106
"jspm": {
104107
"peerDependencies": {

src/directives/formly-field.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo
104104

105105
function parseSet(key, model, newVal) {
106106
// If either of these are null/undefined then just return undefined
107-
if (!key || !model) {
107+
if ((!key && key !== 0) || !model) {
108108
return
109109
}
110110
// If we are working with a number then $parse wont work, default back to the old way for now
@@ -121,7 +121,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo
121121

122122
function parseGet(key, model) {
123123
// If either of these are null/undefined then just return undefined
124-
if (!key || !model) {
124+
if ((!key && key !== 0) || !model) {
125125
return undefined
126126
}
127127

src/directives/formly-field.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,13 @@ describe('formly-field', function() {
500500
expect(scope.fields[0].initialValue).to.eq(defaultValue)
501501
})
502502

503+
it(`should be set if the key is 0`, () => {
504+
scope.fields[0].key = 0
505+
compileAndDigest()
506+
507+
expect(scope.fields[0].initialValue).to.eq(defaultValue)
508+
})
509+
503510
describe(`nested keys`, () => {
504511
const nestedObject = 'foo.bar'
505512
const nestedArray = 'baz[0]'
@@ -546,6 +553,19 @@ describe('formly-field', function() {
546553
expect(scope.model[key]).to.eq(defaultValue)
547554
})
548555

556+
it('should get and set values when key is 0', () => {
557+
const key = 0
558+
const defaultValue = 'bar'
559+
560+
scope.fields = [
561+
{template: input, key, defaultValue},
562+
]
563+
scope.model = {}
564+
565+
compileAndDigest()
566+
expect(scope.model[key]).to.eq(defaultValue)
567+
})
568+
549569
it('should get and set values when key is alpha numeric with alpha first', () => {
550570
const key = 'A1'
551571
const defaultValue = 'bar'

src/directives/formly-form.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ describe('formly-form', () => {
993993
return _.map(fields, field => {
994994
const newField = {data: {}}
995995
_.each(field, (val, name) => {
996-
if (_.contains(extraKeys, name)) {
996+
if (_.includes(extraKeys, name)) {
997997
newField.data[name] = val
998998
} else {
999999
newField[name] = val

0 commit comments

Comments
 (0)