angular-formly
Advanced tools
Comparing version 7.3.4 to 7.3.5
{ | ||
"name": "angular-formly", | ||
"version": "7.3.4", | ||
"version": "7.3.5", | ||
"author": "Astrism <astrisms@gmail.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -1551,2 +1551,23 @@ /* eslint no-shadow:0 */ | ||
it(`should add watches on deep dive fields`, () => { | ||
const formWithOptions = '<formly-form model="model" fields="fields" options="options"></formly-form>' | ||
scope.model = {} | ||
scope.options = {} | ||
const deepLinkField = getNewField() | ||
deepLinkField.key = 'foo.bar' | ||
deepLinkField.watcher = { | ||
listener: sinon.spy(), | ||
} | ||
scope.fields = [deepLinkField] | ||
compileAndDigest(formWithOptions) | ||
expect(deepLinkField.watcher.listener).to.have.been.called | ||
scope.model.foo = { | ||
bar: 'brown', | ||
} | ||
scope.$digest() | ||
expect(deepLinkField.watcher.listener).to.have.been.called | ||
}) | ||
it('should make original model available on field scope, even another model has been set for field', () => { | ||
@@ -1553,0 +1574,0 @@ |
@@ -293,3 +293,3 @@ import angular from 'angular-fix' | ||
function getWatchExpression(watcher, field, index) { | ||
let watchExpression = watcher.expression || `model['${field.key}']` | ||
let watchExpression = watcher.expression || 'model[\'' + field.key.toString().split('.').join('\'][\'') + '\']' | ||
if (angular.isFunction(watchExpression)) { | ||
@@ -296,0 +296,0 @@ // wrap the field's watch expression so we can call it with the field as the first arg |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
640579
10292