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

Commit

Permalink
v8.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
formly-bot committed Mar 19, 2016
2 parents 602cf76 + c07a358 commit dc7abef
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ branches:
notifications:
email: false
node_js:
- iojs
- 4.2
before_install:
- npm i -g npm@^2.0.0
- npm i -g npm@^3.0.0
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
before_script:
Expand Down
32 changes: 16 additions & 16 deletions dist/formly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* angular-formly JavaScript Library v8.0.4
* angular-formly JavaScript Library v8.0.5
*
* @license MIT (http://license.angular-formly.com)
*
Expand Down Expand Up @@ -153,7 +153,7 @@ return /******/ (function(modules) { // webpackBootstrap

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

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

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

'use strict';

formlyUsability.$inject = ["formlyApiCheck", "formlyErrorAndWarningsUrlPrefix"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -505,7 +506,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
}
formlyUsability.$inject = ["formlyApiCheck", "formlyErrorAndWarningsUrlPrefix"];
module.exports = exports['default'];

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

'use strict';

formlyConfig.$inject = ["formlyUsabilityProvider", "formlyErrorAndWarningsUrlPrefix", "formlyApiCheck"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -832,7 +833,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
}
}
formlyConfig.$inject = ["formlyUsabilityProvider", "formlyErrorAndWarningsUrlPrefix", "formlyApiCheck"];
module.exports = exports['default'];

/***/ },
Expand Down Expand Up @@ -1061,6 +1061,7 @@ return /******/ (function(modules) { // webpackBootstrap

'use strict';

formlyWarn.$inject = ["formlyConfig", "formlyErrorAndWarningsUrlPrefix", "$log"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand All @@ -1081,7 +1082,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
};
}
formlyWarn.$inject = ["formlyConfig", "formlyErrorAndWarningsUrlPrefix", "$log"];
module.exports = exports['default'];

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

'use strict';

formlyCustomValidation.$inject = ["formlyUtil"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -1180,7 +1181,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
};
}
formlyCustomValidation.$inject = ["formlyUtil"];
module.exports = exports['default'];

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

'use strict';

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

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

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

function parseGet(key, model) {
// If either of these are null/undefined then just return undefined
if (!key || !model) {
if (!key && key !== 0 || !model) {
return undefined;
}

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

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

'use strict';

formlyFocus.$inject = ["$timeout", "$document"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -1998,7 +1999,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
};
}
formlyFocus.$inject = ["$timeout", "$document"];
module.exports = exports['default'];

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

'use strict';

formlyForm.$inject = ["formlyUsability", "formlyWarn", "$parse", "formlyConfig", "$interpolate"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand All @@ -2029,8 +2030,8 @@ return /******/ (function(modules) { // webpackBootstrap
*/
// @ngInject
function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpolate) {
var currentFormId = 1;
FormlyFormController.$inject = ["$scope", "formlyApiCheck", "formlyUtil"];
var currentFormId = 1;
return {
restrict: 'AE',
template: formlyFormGetTemplate,
Expand Down Expand Up @@ -2477,7 +2478,6 @@ return /******/ (function(modules) { // webpackBootstrap
return field && !!field.fieldGroup;
}
}
formlyForm.$inject = ["formlyUsability", "formlyWarn", "$parse", "formlyConfig", "$interpolate"];
module.exports = exports['default'];

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

'use strict';

addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -2726,7 +2727,6 @@ return /******/ (function(modules) { // webpackBootstrap
return (0, _otherUtils.contains)(key, '.') || (0, _otherUtils.contains)(key, '[') && (0, _otherUtils.contains)(key, ']');
}
}
addFormlyNgModelAttrsManipulator.$inject = ["formlyConfig", "$interpolate"];
module.exports = exports['default'];

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

'use strict';

addCustomTags.$inject = ["$document"];
Object.defineProperty(exports, '__esModule', {
value: true
});
Expand Down Expand Up @@ -2762,7 +2763,6 @@ return /******/ (function(modules) { // webpackBootstrap
})();
}
}
addCustomTags.$inject = ["$document"];
module.exports = exports['default'];

/***/ }
Expand Down
6 changes: 3 additions & 3 deletions dist/formly.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/formly.min.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions other/karma.conf.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(config) {
basePath: './',
frameworks: ['sinon-chai', 'chai', 'mocha', 'sinon'],
files: [
'node_modules/lodash/index.js',
'node_modules/lodash/lodash.js',
'node_modules/api-check/dist/api-check.js',
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
Expand Down Expand Up @@ -54,4 +54,3 @@ function getReporters() {
}
return reps;
}

61 changes: 32 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-formly",
"version": "8.0.4",
"version": "8.0.5",
"author": "Astrism <astrisms@gmail.com>",
"contributors": [
"Astrism <astrisms@gmail.com>",
Expand All @@ -27,8 +27,8 @@
"build:dist": "webpack --progress --colors --set-env-NODE_ENV=development",
"build:prod": "webpack --progress --colors --set-env-NODE_ENV=production",
"build": "npm run build:dist & npm run build:prod",
"eslint:test": "eslint -c other/test.eslintrc --ignore-pattern '**/*.+(test|mock).js' src/",
"eslint:src": "eslint -c other/src.eslintrc --ignore-pattern '!**/*.+(test|mock).js' src/",
"eslint:test": "eslint -c other/test.eslintrc --ignore-pattern **/*.{test,mock}.js src/",
"eslint:src": "eslint -c other/src.eslintrc --ignore-pattern !**/*.{test,mock}.js src/",
"eslint": "npm run eslint:test -s && npm run eslint:src -s",
"test": "karma start --single-run --set-env-COVERAGE=true --set-env-NODE_ENV=test",
"test:watch": "karma start --set-env-COVERAGE=true --set-env-NODE_ENV=test",
Expand All @@ -54,51 +54,54 @@
"api-check": "^7.0.0"
},
"devDependencies": {
"angular": "1.4.7",
"angular-mocks": "1.4.7",
"api-check": "7.5.3",
"argv-set-env": "1.0.0",
"angular": "1.5.0",
"angular-mocks": "1.5.0",
"api-check": "7.5.5",
"argv-set-env": "1.0.1",
"babel": "5.8.23",
"babel-eslint": "4.1.3",
"babel-loader": "5.3.2",
"chai": "3.4.0",
"chai": "3.5.0",
"codecov.io": "0.1.6",
"commitizen": "2.3.0",
"cracks": "3.1.1",
"cz-conventional-changelog": "1.1.4",
"commitizen": "2.7.2",
"cracks": "3.1.2",
"cz-conventional-changelog": "1.1.5",
"deindent": "0.1.0",
"eslint": "1.7.3",
"eslint-config-kentcdodds": "5.0.0",
"eslint-loader": "1.1.0",
"eslint-plugin-mocha": "1.0.0",
"ghooks": "1.0.0",
"http-server": "0.8.5",
"ghooks": "1.0.3",
"gulp": "3.9.1",
"gulp-replace": "0.5.4",
"http-server": "0.9.0",
"isparta": "3.1.0",
"isparta-loader": "1.0.0",
"istanbul": "0.4.0",
"karma": "0.13.14",
"istanbul": "0.4.2",
"karma": "0.13.22",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "0.2.1",
"karma-coverage": "0.5.3",
"karma-firefox-launcher": "0.1.6",
"karma-mocha": "0.2.0",
"karma-chrome-launcher": "0.2.2",
"karma-coverage": "0.5.5",
"karma-firefox-launcher": "0.1.7",
"karma-mocha": "0.2.2",
"karma-sinon": "1.0.4",
"karma-sinon-chai": "1.1.0",
"karma-sinon-chai": "1.2.0",
"karma-webpack": "1.7.0",
"lodash": "3.10.1",
"mocha": "2.3.3",
"ng-annotate": "1.0.2",
"ng-annotate-loader": "0.0.10",
"node-libs-browser": "0.5.3",
"lodash": "4.6.1",
"lolex": "1.4.0",
"mocha": "2.4.5",
"ng-annotate": "1.2.1",
"ng-annotate-loader": "0.1.0",
"node-libs-browser": "1.0.0",
"path-here": "1.1.0",
"publish-latest": "1.1.2",
"raw-loader": "0.5.1",
"semantic-release": "4.3.5",
"sinon": "1.17.2",
"sinon": "1.17.3",
"sinon-chai": "2.8.0",
"validate-commit-msg": "1.0.0",
"webpack": "1.12.2",
"webpack-notifier": "1.2.1"
"validate-commit-msg": "2.3.1",
"webpack": "1.12.14",
"webpack-notifier": "1.3.0"
},
"jspm": {
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/directives/formly-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function formlyField($http, $q, $compile, $templateCache, $interpolate, formlyCo

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

function parseGet(key, model) {
// If either of these are null/undefined then just return undefined
if (!key || !model) {
if ((!key && key !== 0) || !model) {
return undefined
}

Expand Down
20 changes: 20 additions & 0 deletions src/directives/formly-field.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,13 @@ describe('formly-field', function() {
expect(scope.fields[0].initialValue).to.eq(defaultValue)
})

it(`should be set if the key is 0`, () => {
scope.fields[0].key = 0
compileAndDigest()

expect(scope.fields[0].initialValue).to.eq(defaultValue)
})

describe(`nested keys`, () => {
const nestedObject = 'foo.bar'
const nestedArray = 'baz[0]'
Expand Down Expand Up @@ -546,6 +553,19 @@ describe('formly-field', function() {
expect(scope.model[key]).to.eq(defaultValue)
})

it('should get and set values when key is 0', () => {
const key = 0
const defaultValue = 'bar'

scope.fields = [
{template: input, key, defaultValue},
]
scope.model = {}

compileAndDigest()
expect(scope.model[key]).to.eq(defaultValue)
})

it('should get and set values when key is alpha numeric with alpha first', () => {
const key = 'A1'
const defaultValue = 'bar'
Expand Down
2 changes: 1 addition & 1 deletion src/directives/formly-form.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ describe('formly-form', () => {
return _.map(fields, field => {
const newField = {data: {}}
_.each(field, (val, name) => {
if (_.contains(extraKeys, name)) {
if (_.includes(extraKeys, name)) {
newField.data[name] = val
} else {
newField[name] = val
Expand Down

0 comments on commit dc7abef

Please sign in to comment.