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

Commit 9696fc9

Browse files
committed
v7.3.5
2 parents fb235c7 + 4b66e38 commit 9696fc9

File tree

6 files changed

+32
-11
lines changed

6 files changed

+32
-11
lines changed

dist/formly.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* angular-formly JavaScript Library v7.3.4
2+
* angular-formly JavaScript Library v7.3.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', ("7.3.4")); // <-- webpack variable
156+
ngModule.constant('formlyVersion', ("7.3.5")); // <-- webpack variable
157157

158158
ngModule.provider('formlyUsability', _providersFormlyUsability2['default']);
159159
ngModule.provider('formlyConfig', _providersFormlyConfig2['default']);
@@ -424,7 +424,7 @@ return /******/ (function(modules) { // webpackBootstrap
424424
Object.defineProperty(exports, "__esModule", {
425425
value: true
426426
});
427-
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("7.3.4") + "/other/ERRORS_AND_WARNINGS.md#";
427+
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("7.3.5") + "/other/ERRORS_AND_WARNINGS.md#";
428428
module.exports = exports["default"];
429429

430430
/***/ },
@@ -2232,7 +2232,7 @@ return /******/ (function(modules) { // webpackBootstrap
22322232
}
22332233

22342234
function getWatchExpression(watcher, field, index) {
2235-
var watchExpression = watcher.expression || 'model[\'' + field.key + '\']';
2235+
var watchExpression = watcher.expression || 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']';
22362236
if (_angularFix2['default'].isFunction(watchExpression)) {
22372237
(function () {
22382238
// wrap the field's watch expression so we can call it with the field as the first arg

dist/formly.min.js

Lines changed: 4 additions & 4 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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-formly",
3-
"version": "7.3.4",
3+
"version": "7.3.5",
44
"author": "Astrism <[email protected]>",
55
"contributors": [
66
"Astrism <[email protected]>",

src/directives/formly-field.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,27 @@ describe('formly-field', function() {
15481548
expect(expressionPropertySpy).to.have.been.calledOnce
15491549
})
15501550

1551+
it(`should add watches on deep dive fields`, () => {
1552+
const formWithOptions = '<formly-form model="model" fields="fields" options="options"></formly-form>'
1553+
scope.model = {}
1554+
scope.options = {}
1555+
1556+
const deepLinkField = getNewField()
1557+
deepLinkField.key = 'foo.bar'
1558+
deepLinkField.watcher = {
1559+
listener: sinon.spy(),
1560+
}
1561+
1562+
scope.fields = [deepLinkField]
1563+
compileAndDigest(formWithOptions)
1564+
expect(deepLinkField.watcher.listener).to.have.been.called
1565+
scope.model.foo = {
1566+
bar: 'brown',
1567+
}
1568+
scope.$digest()
1569+
expect(deepLinkField.watcher.listener).to.have.been.called
1570+
})
1571+
15511572
it('should make original model available on field scope, even another model has been set for field', () => {
15521573

15531574
scope.model = {foo: 'bar', child: {fox: 'jumps'}}

src/directives/formly-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function formlyForm(formlyUsability, formlyWarn, $parse, formlyConfig, $interpol
290290
}
291291

292292
function getWatchExpression(watcher, field, index) {
293-
let watchExpression = watcher.expression || `model['${field.key}']`
293+
let watchExpression = watcher.expression || 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']'
294294
if (angular.isFunction(watchExpression)) {
295295
// wrap the field's watch expression so we can call it with the field as the first arg
296296
// and the stop function as the last arg as a helper

0 commit comments

Comments
 (0)